Navigation

    Backtrader Community

    • Register
    • 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/

    two PivotPoints in different data,how to getvalue at same datetime?

    General Code/Help
    2
    2
    123
    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.
    • magieva
      magieva last edited by

      I have two datas,1hour,1day.

      cerebro.resampledata(data, timeframe=args.timeframe, compression=60) #1hour
      cerebro.resampledata(data, timeframe=args.timeframe, compression=60 * 24)#1day
      

      two PivotPoint in startegy:

      self.pp = PivotPoint1(subplot=True)
      self.pp_day = bt.ind.PivotPoint(self.data1, _autoplot=True)
      

      when I get self.pp.lines.p[-20],
      How can I get self.pp_day.lines.p[?] ,?=bar index ,
      at the same datatime (self.data0.datetime.datetime(-20))?

      Thank you very much.

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

        Since your other compression is 60*24 and 24 > 20, the answer is 0 (and depending on the stage of the resampling even partially 1, which is actually the future)

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