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/

    ReplayData not working

    General Code/Help
    2
    2
    47
    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.
    • Ravi Vidap
      Ravi Vidap last edited by

      cerebro.adddata(data) is working in below code, but when I replace that call with cerebro.replaydata(data,timeframe=bt.TimeFrame.Days,compression=1)
      Its not working, no errors also.
      Code Snippet:
      stockkwargs = dict(
      timeframe=bt.TimeFrame.Minutes,
      compression=5,
      historical=True, # only historical download
      fromdate=datetime.datetime(2020, 9, 1), # get data from..
      todate=datetime.datetime(2020, 9, 3) # get data from..
      )

      cerebro = bt.Cerebro(stdstats=False)
      store = bt.stores.IBStore(port=7496)
      data = store.getdata(dataname='TCS-STK-NSE-INR',**stockkwargs)
      cerebro.replaydata(data,timeframe=bt.TimeFrame.Days,compression=1)
      cerebro.addstrategy(IntraTrendStrategy)
      cerebro.run()

      1 Reply Last reply Reply Quote 0
      • vladisld
        vladisld last edited by

        Could be the same behavior as the one reported in the following post:
        https://community.backtrader.com/topic/2988/next-not-triggering-on-ibkr-data-feed/2

        It seems the IB store was designed with live trading in mind. The capability of loading the historical data was added as a mean for backfilling the historical data during live trading . So in this regard it less suitable for pure backtesting scenario.

        Am I wrong ? Anyone having a different experience ?

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
        $(document).ready(function () { app.coldLoad(); }); }