Without knowing the actual use of the variable, I added the following and looks like can temporarily fix the issue.
Compare to IB, the EMA top and bot point in the program are much higher (IB value : top 0.7524 bot: 0.7504) but the mid point matches at 0.751423. Also SMA values matches with IB.
Any suggestion how I can further check on this?
Can I use ema instead of default sma for bbands indicator? I tried to pass bt.indicators.MovAv.EMA to param movav when creating bands , the code starts and run without isssue but the bbands top and bot values are much bigger than the expected value.. it works perfectly fine with sma.
RE: next() not generated anymore after "IB and Trader Workstation connectivity lost"
I also believe the daily disconnection was due to IB server reset. Thanks for the pointer to issue #283, I will further check on that.
After receiving the 1100 error message, the program continue to receive tickPrice and tickSize events but the notify_data() and notify_store() events never resumed and next() event is also never get generated. It is not resumed event after receiving the 1102 message from IB "Connectivity between IB and Trader Workstation has been restore - data maintained". To resume, I have to kill the program and restart from fresh.
Has anyone got similar problem and if there is a way to resume the data feed in this scenario without restarting the program?
With IB LIVE data, when using resample and replay e.g. (data, timeframe=Minutes, compression=5), if there is really no market event triggered within the 5 minutes e.g. from 10:00am to 10:05am, no bar will be generated at 10:05am as next() has not been called due to lack of data trigger. Is there available option or standard mechanism that can force generation of the 10:05am bar or it has to be implemented locally? I thought I have the qcheck=0.5 default to force this but seems it has no effect.
With IB LIVE data, when using resample(data, timeframe=Minutes, compression=1), sometime next() will be called multiple times at start of a minute e.g. 10:00am but with exact same values (open, high, low, close and indicators). I have checked the time and sales in IB and there is no trades happened from 09:59:59am and 10:00:01am so wonder what may trigger the duplicate next() call.
I am using IB as broker and called cerebro.replaydata(...) with timeframe=Minutes and compression=1. When receiving DELAYED feed, next() was called with every one minute period, however, when switched to LIVE, the next() call is called many times within the minute which looks like tick from IB. Is it the expected bahavior that the next() is called multiple times during the one minute period during LIVE feed?
Is it possible to get latest bid/ask in the next() call together with other line data e.g. open, high, low or need to be a separate data feed? I tried to search some previous discussion on this topic but still not sure if it is possible yet..
I am trying to build a strategy that reads AUD.USD.CASH-IDEALPRO and AUD Futures. For AUD.USD.CASH feed, I would like to build indicators base on 5 and 15 minutes period and for AUD Futures I would like to get the latest bid/ask price at the point when placing Futures orders. Should I create 3 data feeds for above e.g.
Sorry if these are very primitive questions and any help will be much appreciated.