Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Does BackTrader support the "Adaptive" order of IB?

    General Code/Help
    2
    3
    60
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      adrianyuen last edited by

      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 1 Reply Last reply Reply Quote 0
      • vladisld
        vladisld @adrianyuen 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).

        However, the buy/sell methods of the strategy accept kwargs parameters 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``
        
        A 1 Reply Last reply Reply Quote 3
        • A
          adrianyuen @vladisld last edited by

          @vladisld Thanks a lot!

          1 Reply Last reply Reply Quote 1
          • 1 / 1
          • First post
            Last post
          Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors