For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

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

  • 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.

  • administrators

    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)

Log in to reply