Order 'valid' parameter not working while live trading with Interactive Brokers.
-
Hi All -
I am using Backtrader + Interactive Brokers TWS API to trade live on several futures contracts. To open positions, I am using entry stop orders and passing them with a 'valid' time.
This setup has worked fine on my own historical backtesting as well as IBKR's historical data backtesting. However, the parameter seems to fail when working with 5s, real time bars. The orders are not cancelling when the valid time is hit.
I have tried passing the valid variable as a datetime and timedelta. I have tried passing the time delta with minutes and seconds as the unit of time. Please let me know what I can show to make this a bit more clear. Thank you for any and all help!
Best,
Crossland -
What library are you using to connect to IB?
The IBPy specified on the main backtrader website is just not working for me. Do I need Python 2 for it?