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

ReplayData not working

  • 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(
    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)

  • Could be the same behavior as the one reported in the following post:

    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 ?

Log in to reply