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

Struggling to consistently backfill



  • Evening,

    I have read the documentation and the forums exhaustively but I'm struggling to come up with an answer. When I start some of the strategies they permanently hang on "Data Delayed" after the initial successful connection to IB live servers. So it will receive the TWS Successfull connection and then print a "Data Delayed" which I have in the Notify Order function; but it won't progress onto the next function.

    data0 = ibstore.getdata(reqRealTimeBars=True, dataname='BHP-STK-SMART-AUD', rtbar=False,
                                timeframe=bt.TimeFrame.Seconds, compression=1, tradename ='BHP-CFD-SMART-AUD',
                                useRTH=True, fromdate=datetime.datetime.now(pytz.timezone('Australia/Sydney')).date(),
                                backfill=False)
        cerebro.resampledata(data0, timeframe=bt.TimeFrame.Seconds,
                             compression=5)
    

    The asx commences trading in rolling window periods by the alphabetical first letter of the stock's symbol, so some stocks will begin trading at 9.59am while some will not begin trading until 10.09am. With the larger securities, it seems to be much more consistent as I suspect there is a trade to hook in-to.

    Some slightly smaller companies but still very liquid are often the ones to cause problems. So if the Stock were to open at 10.04am, I set the script to begin at 10.04am or 10.04.15am or 10.04.30am sometimes it will work, sometimes it won't.

    I understand Data Delayed is backfilling in progress, but when multiple different stocks will just sit at the initial connection text with the status "Data Delayed" i feel it isn't stuck on backfilling. This also makes it hard to debug as I'm unable to see any of the "debug=True" text, but in the past this hasn't indicated any issues.

    I have tried varying the qcheck value and my only other remaining ideas are to begin the start of the script later and hope to catch a trade or perhaps change the compression to a minute?


 

});