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

Data Backfilling Issue



  • Hi guys. I want to perform backfilling with the platform.

    I have read the document about backfilling Example : Oanda Backfilling, but it seems only support with specific broker (right?).

    Can I perform backfilling without any broker? For example, I pass 50 bars to cerebro at the beginning, then another 50 bars, until the end of the CSV file.

    Thanks!


  • administrators

    If this is simply for backtesting (you mention until the en of the CSV file) you'd be better of chaining the data. See cerebro.chaindata

    Just give it as many data feeds as you wish.



  • I'm using oanda. How to backfill
    now or live start time -2019-6-29 8:52
    my ML working on 100 hour data
    so how to backfill before 100 hour data from oanda in start?



  • StartDate = '2019-06-23T12:00:00'
    StartDate = datetime.datetime.strptime(StartDate,'%Y-%m-%dT%H:%M:%S' )
    End = '2019-06-24T00:00:00'
    End = datetime.datetime.strptime(End,'%Y-%m-%dT%H:%M:%S' )
    
    datahist = oandastore.getdata(dataname="GBP_USD", account_tmout=15,
                                timeframe=bt.TimeFrame.Minutes,
                                historical = True, compression = 1,
                                fromdate=StartDate, todate=End)
    
    data0 = oandastore.getdata(dataname="GBP_USD", account_tmout=15,
                               timeframe=bt.TimeFrame.Ticks,ignore_heartbeat=True,
                               compression=1, backfill_start=datahist, backfill=False)
    
    #This is setting what timeframe we want to use.
    cerebro.resampledata(data0, timeframe=bt.TimeFrame.Minutes, compression=1)
    cerebro.addstrategy(TestStrategy)
    

    This code doesn't work? How to do?



  • data0 = oandastore.getdata(dataname="GBP_USD", account_tmout=15,
                               timeframe=bt.TimeFrame.Ticks,ignore_heartbeat=True,
                               use_positions = True,
                               fromdate=StartDate,
                               compression=1, backfill_start=True, backfill=False)
    

    Is it true? @backtrader


  • administrators

    @chuka said in Data Backfilling Issue:

    so how to backfill before 100 hour data from oanda in start?

    You ask for a start date which is 100 hours in the past ... actually more, because in most cases the trading calendar won't be 24x7 ... there isn't an exact science to backfilling.


Log in to reply
 

});