Does BackTrader support the "Adaptive" order of IB?
Placing an order at market price sometimes get a very poor price. However, limited price order may not be executed. The IB "Adaptive" order at market price maybe a good balance between market and limited price order. However, I can't find any information from online document nor forum. Does BackTrader support such order type? Thank you.
vladisld last edited by
@adrianyuen Backtrader API only defined a minimal set of order execution types that are compatible will all the supported brokers (Market,Limit,Close,Stop,StopLimit,StopTrail,StopTrailLimit).
sellmethods of the strategy accept
kwargsparameters that may add additional, broker specific, information to the broker or overwrite the default values of the order parameters.
Quoting the docs for the IBOrder:
Any extra parameters supplied with kwargs are applied directly to the ib.ext.Order.Order object, which could be used as follows:: Example: if the 4 order execution types directly supported by ``backtrader`` are not enough, in the case of for example *Interactive Brokers* the following could be passed as *kwargs*:: orderType='LIT', lmtPrice=10.0, auxPrice=9.8 This would override the settings created by ``backtrader`` and generate a ``LIMIT IF TOUCHED`` order with a *touched* price of 9.8 and a *limit* price of 10.0. This would be done almost always from the ``Buy`` and ``Sell`` methods of the ``Strategy`` subclass being used in ``Cerebro``
@vladisld Thanks a lot!