Backtrader Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Accessing next day open/high/low/close in next(self)

    Indicators/Strategies/Analyzers
    3
    3
    302
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P dML
      P dML last edited by

      Dear Community

      My strategy is based on an indicator that is the spread between two equities but I do actually trade the underlying shares. How can I access the quantities of those shares when I want to close the positions. getsizing(data) does not seem to work.
      PS: The sizes have been fixed by a fix $ value sizer (eg $500k) so i could not use the sizer again (as the prices change it would give me a new quantity). Thanks in advance.

      Pierre

      1 Reply Last reply Reply Quote 0
      • run-out
        run-out last edited by

        Can you provide examples of your code?

        RunBacktest.com

        1 Reply Last reply Reply Quote 0
        • B
          backtrader administrators last edited by

          Dear @P-dML ,

          For sure your explanation makes sense to you, because you are deep into your problem. But as pointed out by @run-out in the question ... without code there is actually no way to know what you are doing. For example:

          • There is a getsizing(data) thrown into a sentence out of the blue ...

          At least for me it is unclear why that isn't giving you the information you are missing, probably because I also don't know which data feeds are in the equation, what's being targeted, ...

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors