IBKR data feed not sending data
Currently I'm having a problem getting data stream from IBKR. The program appears to be stuck after verified all connections are OK.
I have subscribed into real time market data from IBKR, and verified it by successfully retrieve real data with vanilla ibapi wrapper.
Here is my current TWS API setting.
I have tried various troubleshooting methods but without any solution, including:
- Test running the sample file at https://github.com/mementum/backtrader/blob/master/samples/ibtest/ibtest.py and printing debug message in every step. The pre-next() and next() function appear to be not called
- Waited for 30 minutes for a running instance.
- Follow troubleshoot steps in a few historical threads with the same issue: https://community.backtrader.com/topic/2091/starting-with-interactive-brokers-ib-no-data-feed (OP still can query data for forex but I cannot query for anything, both stock and forex)
& https://community.backtrader.com/topic/1313/ib-backtesting-stuck-at-status-delayed (Turned historical flag on and off)
- Ran script at different times (pre-market, market & after-hour)
- Ran script in both real account (read-only) and paper trading account (port 7496 & 7497)
- Restarted the computer and rerun
- Tried the same above steps with an alternative computer running on Ubuntu 13.04.
- Investigated TWS folder for API log, but found no log file.
Currently I'm running out of troubleshooting idea at the moment, so any advise would be much appreciated.
Thanks in advance!
Build 10.18.1e, Sep 20, 2022 4:11:21 PM Jolt Build 1.18.9, Jul 5, 2022 05:27:19 PM Nia Build 2.24.2, Jan 17, 2022 05:48:10 PM ModelNav Build 1.13.2, Jan 24, 2022 04:59:21 PM Riskfeed Build 2.45.3, Jul 25, 2022 06:42:42 PM
backtrader 188.8.131.52 ibapi 9.81.1.post1 IbPy2 0.8.0 pip 22.2.2 ta 0.10.2 yfinance 0.1.74
@vuduclong0309 Update: I was able to get the API Log for TWS. I noticed that there appear to be a sending error for every data send (marked with red)
@vuduclong0309 Update: Found root cause and temporary workaround:
TWS 10.17 Changed format for timezone, affecting historical data request. Ref: https://forum.amibroker.com/t/please-look-at-timeinforce-part-of-place-order-code/31980
Change to use TWS at STABLE version (10.12) instead of LATEST version (10.17). https://agenatrader.com/wiki/tiki-index.php?page=How+to+change+TWS+version+from+Latest+to+Stable
Reran the code, appear to be normal
Nonetheless, this temporary solution might be invalidated when TWS decide to keep the change and make 10.17 to be the STABLE version
Hope this can help anyone who have the same problem, I'm still looking for a permanent fix on this issue.