Skip to content

Feature Request: Add Support for SMART + OVERNIGHT Order Type in ib_async #196

@osjayaprakash

Description

@osjayaprakash

Feature Request: Add Support for SMART + OVERNIGHT Order Type in ib_async

Currently, ib_async requires users to manually switch the exchange parameter between "OVERNIGHT" for overnight sessions and "SMART" for regular/pre-market/after-market hours. This workflow is inconvenient. The TWS API now supports a simplified order type that eliminates the need to change exchanges when transitioning between overnight and regular trading sessions. According to IBKR technical support, this can be implemented as follows:

Thank you for contacting Interactive Brokers.

Assuming that you are speaking of the OVERNIGHT + DAY time in force, as displayed in TWS, you may implement this in the TWS API in the following way:

  • Set the exchange of your Contract object to "SMART"
  • Set the TIF of your order to "DAY"
  • Set the includeOvernight boolean flag of the Order object to True

Using AAPL stock as an example:

# Define contract
contract = Contract()
contract.symbol = "AAPL"
contract.secType = "STK"
contract.currency = "USD"
contract.exchange = "SMART"

# Define order
order = Order()
order.action = "BUY"
order.totalQuantity = 1
order.orderType = "LMT"
order.lmtPrice = 267.32
order.tif = "DAY"
order.includeOvernight = True

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions