Interactive Broker order OutsideRth attribute
In both IB API and ibPy API there is reference to the OutsideRth attribute of an order.
Looks like in Backtrader the attribute is not exposed. Is there any way I can tweak the attribute inside Backtrader for live trading? And is the default attribute of this setting False?
jmoons last edited by
Actucally, you can set the OutsideRth attribute like this:
self.order = self.buy( size=1, exectype=bt.Order.Limit, price=someprice, outsideRth=True )
@jmoons thanks I will try it.
Documented here: Docs - Live Data Feeds and Live Trading - Interactive Brokers
ibpywas using the Java API source as the building cornerstone, the actual argument name is:
But you can pass it without the leading
m_and the code will dynamically add it for you in the background.
@backtrader cool thanks a lot!
Hi Kevin --
Another option for you is to use the IB data cache code that brettelliot wrote at https://community.backtrader.com/topic/1007/how-to-cached-data-from-ib-and-use-it-later/2
It exposes the IB connection so that the ib api parameter for RTH is available (use_rth).
Also gets you a nice cache and a bit of a speedup as well.
@bigdavediode thanks I will look into this.