Interface Order

The order's description.

Hierarchy

  • Order

Properties

account? action? activeStartTime? activeStopTime? adjustableTrailingUnit? adjustedOrderType? adjustedStopLimitPrice? adjustedStopPrice? adjustedTrailingAmount? advancedErrorOverride? algoId? algoParams? algoStrategy? allOrNone? auctionStrategy? autoCancelDate? autoCancelParent? auxPrice? basisPoints? basisPointsType? blockOrder? cashQty? clearingAccount? clearingIntent? clientId? competeAgainstBestOffset? conditions? conditionsCancelOrder? conditionsIgnoreRth? continuousUpdate? delta? deltaNeutralAuxPrice? deltaNeutralClearingAccount? deltaNeutralClearingIntent? deltaNeutralConId? deltaNeutralDesignatedLocation? deltaNeutralOpenClose? deltaNeutralOrderType? deltaNeutralSettlingFirm? deltaNeutralShortSale? deltaNeutralShortSaleSlot? designatedLocation? discretionaryAmt? discretionaryUpToLimitPrice? displaySize? dontUseAutoPriceForHedge? duration? eTradeOnly? exemptCode? extOperator? faGroup? faMethod? faPercentage? faProfile? filledQuantity? firmQuoteOnly? goodAfterTime? goodTillDate? hedgeParam? hedgeType? hidden? imbalanceOnly? isOmsContainer? isPeggedChangeAmountDecrease? lmtPrice? lmtPriceOffset? manualOrderTime? midOffsetAtHalf? midOffsetAtWhole? mifid2DecisionAlgo? mifid2DecisionMaker? mifid2ExecutionAlgo? mifid2ExecutionTrader? minCompeteSize? minQty? minTradeQty? modelCode? nbboPriceCap? notHeld? ocaGroup? ocaType? openClose? optOutSmartRouting? orderComboLegs? orderId? orderMiscOptions? orderRef? orderType? origin? outsideRth? overridePercentageConstraints? parentId? parentPermId? peggedChangeAmount? percentOffset? permId? postToAts? randomizePrice? randomizeSize? refFuturesConId? referenceChangeAmount? referenceContractId? referenceExchangeId? referencePriceType? routeMarketableToBbo? rule80A? scaleAutoReset? scaleInitFillQty? scaleInitLevelSize? scaleInitPosition? scalePriceAdjustInterval? scalePriceAdjustValue? scalePriceIncrement? scaleProfitOffset? scaleRandomPercent? scaleSubsLevelSize? scaleTable? settlingFirm? shareholder? shortSaleSlot? smartComboRoutingParams? softDollarTier? solicited? startingPrice? stockRangeLower? stockRangeUpper? stockRefPrice? sweepToFill? tier? tif? totalQuantity? trailStopPrice? trailingPercent? transmit? triggerMethod? triggerPrice? usePriceMgmtAlgo? volatility? volatilityType? whatIf?

Properties

account?: string

The account the trade will be allocated to.

action?: OrderAction

Identifies the side.

Generally available values are BUY, SELL.

Additionally, SSHORT, SLONG are available in some institutional-accounts only.

For general account types, a SELL order will be able to enter a short position automatically if the order quantity is larger than your current long position.

SSHORT is only supported for institutional account configured with Long/Short account segments or clearing with a separate account.

SLONG is available in specially-configured institutional accounts to indicate that long position not yet delivered is being sold.

activeStartTime?: TagValue[]

For GTC orders.

activeStopTime?: TagValue[]

For GTC orders.

adjustableTrailingUnit?: number

Adjusted Stop orders: specifies where the trailing unit is an amount (set to 0) or a percentage (set to 1)

adjustedOrderType?: string

Adjusted Stop orders: the parent order will be adjusted to the given type when the adjusted trigger price is penetrated.

adjustedStopLimitPrice?: number

Adjusted Stop orders: specifies the stop limit price of the adjusted (STPL LMT) parent.

adjustedStopPrice?: number

Adjusted Stop orders: specifies the stop price of the adjusted (STP) parent.

adjustedTrailingAmount?: number

Adjusted Stop orders: specifies the trailing amount of the adjusted (TRAIL) parent.

advancedErrorOverride?: string

Accepts a list with parameters obtained from advancedOrderRejectJson

algoId?: string

TODO document.

algoParams?: TagValue[]

The list of parameters for the IB algorithm.

For more information about IB's API algorithms, refer to https://www.interactivebrokers.com/en/software/api/apiguide/tables/ibalgo_parameters.htm.

algoStrategy?: string

The algorithm strategy.

As of API version 9.6, the following algorithms are supported:

  • ArrivalPx - Arrival Price
  • DarkIce - Dark Ice
  • PctVol - Percentage of Volume
  • Twap - TWAP (Time Weighted Average Price)
  • Vwap - VWAP (Volume Weighted Average Price)

For more information about IB's API algorithms, refer to https://www.interactivebrokers.com/en/software/api/apiguide/tables/ibalgo_parameters.htm.

allOrNone?: boolean

Indicates whether or not all the order has to be filled on a single execution.

auctionStrategy?: number

For BOX orders only.

Possible values:

  • 1 - match
  • 2 - improvement
  • 3 - transparent
autoCancelDate?: string

TODO: document

autoCancelParent?: boolean

TODO: document

auxPrice?: number

Generic field to contain the stop price for STP LMT orders, trailing amount, etc.

basisPoints?: number

TODO document. For EFP orders only.

basisPointsType?: number

TODO document. For EFP orders only.

blockOrder?: boolean

If set to true, specifies that the order is an ISE Block order.

cashQty?: number

The native cash quantity.

clearingAccount?: string

Specifies the true beneficiary of the order.

For IBExecution customers.

This value is required for FUT/FOP orders for reporting to the exchange.

clearingIntent?: string

For execution-only clients to know where do they want their shares to be cleared at. Valid values are: IB, Away, and PTA (post trade allocation).

clientId?: number

The API client id which placed the order.

competeAgainstBestOffset?: number

Specifies the offset Off The Midpoint that will be applied to the order. For IBKRATS orders.

conditions?: OrderCondition[]

Conditions determining when the order will be activated or canceled.

conditionsCancelOrder?: boolean

Conditions can determine if an order should become active or canceled.

conditionsIgnoreRth?: boolean

Indicates whether or not conditions will also be valid outside Regular Trading Hours.

continuousUpdate?: number

Specifies whether TWS will automatically update the limit price of the order as the underlying price moves.

VOL orders only.

delta?: number

The stock's Delta. For orders on BOX only.

deltaNeutralAuxPrice?: number

Use this field to enter a value if the value in the deltaNeutralOrderType field is an order type that requires an Aux price, such as a REL order.

VOL orders only.

deltaNeutralClearingAccount?: string

TODO document

deltaNeutralClearingIntent?: string

TODO document

deltaNeutralConId?: number

TODO document

deltaNeutralDesignatedLocation?: string

Used only when [[deltaNeutralShortSaleSlot]] = 2.

deltaNeutralOpenClose?: string

Specifies whether the order is an Open or a Close order and is used when the hedge involves a CFD and and the order is clearing away.

deltaNeutralOrderType?: string

Enter an order type to instruct TWS to submit a delta neutral trade on full or partial execution of the VOL order.

VOL orders only.

For no hedge delta order to be sent, specify NONE.

deltaNeutralSettlingFirm?: string

TODO document

deltaNeutralShortSale?: boolean

Used when the hedge involves a stock and indicates whether or not it is sold short.

deltaNeutralShortSaleSlot?: number

Has a value of 1 (the clearing broker holds shares) or 2 (delivered from a third party). If you use 2, then you must specify a [[deltaNeutralDesignatedLocation]].

designatedLocation?: string

Used only when shortSaleSlot is 2.

For institutions only.

Indicates the location where the shares to short come from. Used only when short sale slot is set to 2 (which means that the shares to short are held elsewhere and not with IB).

discretionaryAmt?: number

The amount off the limit price allowed for discretionary orders.

discretionaryUpToLimitPrice?: boolean

Set to true to convert order of type 'Primary Peg' to 'D-Peg'.

displaySize?: number

The publicly disclosed order size, used when placing Iceberg orders.

dontUseAutoPriceForHedge?: boolean

Don't use auto price for hedge.

duration?: number

Specifies the duration of the order. Format: yyyymmdd hh:mm:ss TZ. For GTD orders.

eTradeOnly?: boolean

Trade with electronic quotes.

exemptCode?: number

Only available with IB Execution-Only accounts with applicable securities Mark order as exempt from short sale uptick rule.

extOperator?: string

This is a regulatory attribute that applies to all US Commodity (Futures) Exchanges, provided to allow client to comply with CFTC Tag 50 Rules.

faGroup?: string

The Financial Advisor group the trade will be allocated to. Use an empty string if not applicable.

faMethod?: string

The Financial Advisor allocation method the trade will be allocated to. Use an empty string if not applicable.FaMethod

faPercentage?: string

The Financial Advisor percentage concerning the trade's allocation. Use an empty string if not applicable.

faProfile?: string

Deprecated

The Financial Advisor allocation profile the trade will be allocated to. Use an empty string if not applicable.

filledQuantity?: number

TODO: document

firmQuoteOnly?: boolean

Trade with firm quotes.

goodAfterTime?: string

Specifies the date and time after which the order will be active. Format: yyyymmdd hh:mm:ss {optional Timezone}.

goodTillDate?: string

The date and time until the order will be active. You must enter GTD as the time in force to use this string. The trade's "Good Till Date," format "YYYYMMDD hh:mm:ss (optional time zone)".

hedgeParam?: string

Beta = x for Beta hedge orders, ratio = y for Pair hedge order

hedgeType?: string

For hedge orders.

Possible values include:

  • D - delta
  • B - beta
  • F - FX
  • P - Pair
hidden?: boolean

If set to true, the order will not be visible when viewing the market depth. This option only applies to orders routed to the ISLAND exchange.

imbalanceOnly?: boolean

TODO: document

isOmsContainer?: boolean

Set to true to create tickets from API orders when TWS is used as an OMS.

isPeggedChangeAmountDecrease?: boolean

Pegged-to-benchmark orders: indicates whether the order's pegged price should increase or decreases.

lmtPrice?: number

The LIMIT price.

Used for limit, stop-limit and relative orders. In all other cases specify zero. For relative orders with no limit price, also specify zero.

lmtPriceOffset?: number

TODO: document

manualOrderTime?: string

Used by brokers and advisors when manually entering, modifying or cancelling orders at the direction of a client. Only used when allocating orders to specific groups or accounts. Excluding "All" group.

midOffsetAtHalf?: number

This offset is applied when the spread is an odd number of cents wide. This offset must be in half-penny increments. For IBKRATS orders.

midOffsetAtWhole?: number

This offset is applied when the spread is an even number of cents wide. This offset must be in whole-penny increments or zero. For IBKRATS orders.

mifid2DecisionAlgo?: string

Identifies the algorithm responsible for investment decisions within the firm. Orders covered under MiFID 2 must include either [[mifid2DecisionMaker]] or [[mifid2DecisionAlgo]], but cannot have both.

Requires TWS 969+.

mifid2DecisionMaker?: string

Identifies a person as the responsible party for investment decisions within the firm.

Orders covered by MiFID 2 (Markets in Financial Instruments Directive 2) must include either [[mifid2DecisionMaker]] or [[mifid2DecisionAlgo]] field (but not both).

Requires TWS 969+.

mifid2ExecutionAlgo?: string

For MiFID 2 reporting; identifies the algorithm responsible for the execution of a transaction within the firm.

Requires TWS 969+.

mifid2ExecutionTrader?: string

For MiFID 2 reporting; identifies a person as the responsible party for the execution of a transaction within the firm.

Requires TWS 969+.

minCompeteSize?: number

Defines the minimum size to compete. For IBKRATS orders.

minQty?: number

Identifies a minimum quantity order type.

minTradeQty?: number

Defines the minimum trade quantity to fill. For IBKRATS orders.

modelCode?: string
nbboPriceCap?: number

Maximum smart order distance from the NBBO.

notHeld?: boolean

Orders routed to IBDARK are tagged as “post only” and are held in IB's order book, where incoming SmartRouted orders from other IB customers are eligible to trade against them.

For IBDARK orders only.

ocaGroup?: string

One-Cancels-All group identifier.

ocaType?: number

Tells how to handle remaining orders in an OCA group when one order or part of an order executes.

Valid values are:

  • 1 = Cancel all remaining orders with block.
  • 2 = Remaining orders are proportionately reduced in size with block.
  • 3 = Remaining orders are proportionately reduced in size with no block.

If you use a value "with block" it gives the order overfill protection. This means that only one order in the group will be routed at a time to remove the possibility of an overfill.

openClose?: string

For institutional customers only.

Valid values are O (open), C (close).

Available for institutional clients to determine if this order is to open or close a position.

When Action = "BUY" and OpenClose = "O" this will open a new position.

When Action = "BUY" and OpenClose = "C" this will close and existing short position.

optOutSmartRouting?: boolean

Use to opt out of default SmartRouting for orders routed directly to ASX. This attribute defaults to false unless explicitly set to true.

When set to false, orders routed directly to ASX will NOT use SmartRouting. When set to true, orders routed directly to ASX orders WILL use SmartRouting.

orderComboLegs?: OrderComboLeg[]

List of Per-leg price following the same sequence combo legs are added.

The combo price must be left unspecified when using per-leg prices.

orderId?: number

The API client's order id.

orderMiscOptions?: TagValue[]

TODO document

orderRef?: string

The order reference.

Intended for institutional customers only, although all customers may use it to identify the API client that sent the order when multiple API clients are running.

orderType?: OrderType

The order's type.

origin?: number

The order's origin. Same as TWS "Origin" column.

Identifies the type of customer from which the order originated.

Valid values are 0 (customer), 1 (firm).

outsideRth?: boolean

If set to true, allows orders to also trigger or fill outside of regular trading hours.

overridePercentageConstraints?: boolean

Overrides TWS constraints. Precautionary constraints are defined on the TWS Presets page, and help ensure that your price and size order values are reasonable. Orders sent from the API are also validated against these safety constraints, and may be rejected if any constraint is violated.

To override validation, set this parameter’s value to true.

parentId?: number

The order ID of the parent order, used for bracket and auto trailing stop orders.

parentPermId?: number

TODO: document

peggedChangeAmount?: number

Pegged-to-benchmark orders: amount by which the order's pegged price should move.

percentOffset?: number

The percent offset amount for relative orders.

permId?: number

The Host order identifier.

postToAts?: number

Value must be positive, and it is number of seconds that SMART order would be parked for at IBKRATS before being routed to exchange.

randomizePrice?: boolean

TODO: document

randomizeSize?: boolean

TODO: document

refFuturesConId?: number

TODO: document

referenceChangeAmount?: number

Pegged-to-benchmark orders: the amount the reference contract needs to move to adjust the pegged order.

referenceContractId?: number

Pegged-to-benchmark orders: this attribute will contain the conId of the contract against which the order will be pegged.

referenceExchangeId?: string

Pegged-to-benchmark orders: the exchange against which we want to observe the reference contract.

referencePriceType?: number

Specifies how you want TWS to calculate the limit price for options, and for stock range price monitoring.

VOL orders only.

Valid values include:

  • 1 - Average of NBBO
  • 2 - NBB or the NBO depending on the action and right.
routeMarketableToBbo?: boolean

TODO: document

rule80A?: string

Possible values:

  • Individual = 'I'
  • Agency = 'A'
  • AgentOtherMember = 'W'
  • IndividualPTIA = 'J'
  • AgencyPTIA = 'U'
  • AgentOtherMemberPTIA = 'M'
  • IndividualPT = 'K'
  • AgencyPT = 'Y'
  • AgentOtherMemberPT = 'N'
scaleAutoReset?: boolean

TODO document. For extended Scale orders.

scaleInitFillQty?: number

TODO document. For extended Scale orders.

scaleInitLevelSize?: number

Defines the size of the first, or initial, order component.

For Scale orders only.

scaleInitPosition?: number

TODO document. For extended Scale orders.

scalePriceAdjustInterval?: number

TODO document. For extended Scale orders.

scalePriceAdjustValue?: number

TODO document. For extended Scale orders.

scalePriceIncrement?: number

Defines the price increment between scale components.

For Scale orders only. This value is compulsory.

scaleProfitOffset?: number

TODO document. For extended Scale orders.

scaleRandomPercent?: boolean

TODO document. For extended Scale orders.

scaleSubsLevelSize?: number

Defines the order size of the subsequent scale order components.

For Scale orders only. Used in conjunction with scaleInitLevelSize().

scaleTable?: string

Used for scale orders.

settlingFirm?: string

Institutions only.

Indicates the firm which will settle the trade.

shareholder?: string

TODO: document

shortSaleSlot?: number

For institutions only. Valid values are:

  • 1 - broker holds shares.
  • 2 - shares come from elsewhere.
smartComboRoutingParams?: TagValue[]

Advanced parameters for Smart combo routing.

These features are for both guaranteed and non-guaranteed combination orders routed to Smart, and are available based on combo type and order type. SmartComboRoutingParams is similar to AlgoParams in that it makes use of tag/value pairs to add parameters to combo orders.

Make sure that you fully understand how Advanced Combo Routing works in TWS itself first: https://www.interactivebrokers.com/en/software/tws/usersguidebook/specializedorderentry/advanced_combo_routing.htm

The parameters cover the following capabilities:

  • Non-Guaranteed - Determine if the combo order is Guaranteed or Non-Guaranteed.

Tag = NonGuaranteed

Value = 0: The order is guaranteed

Value = 1: The order is non-guaranteed

  • Select Leg to Fill First - User can specify which leg to be executed first.

Tag = LeginPrio

Value = -1: No priority is assigned to either combo leg

Value = 0: Priority is assigned to the first leg being added to the comboLeg

Value = 1: Priority is assigned to the second leg being added to the comboLeg

Note: The LeginPrio parameter can only be applied to two-legged combo.

  • Maximum Leg-In Combo Size - Specify the maximum allowed leg-in size per segment

Tag = MaxSegSize

Value = Unit of combo size

  • Do Not Start Next Leg-In if Previous Leg-In Did Not Finish - Specify whether or not the system should attempt to fill the next segment before the current segment fills.

Tag = DontLeginNext

Value = 0: Start next leg-in even if previous leg-in did not finish Value = 1: Do not start next leg-in if previous leg-in did not finish

  • Price Condition - Combo order will be rejected or cancelled if the leg market price is outside of the specified price range [CondPriceMin, CondPriceMax]

Tag = PriceCondConid: The ContractID of the combo leg to specify price condition on

Value = The ContractID

Tag = CondPriceMin: The lower price range of the price condition

Value = The lower price

Tag = CondPriceMax: The upper price range of the price condition

Value = The upper price

softDollarTier?: SoftDollarTier

Define the Soft Dollar Tier used for the order. Only provided for registered professional advisors and hedge and mutual funds.

solicited?: boolean

TODO document

startingPrice?: number

The auction's starting price. For BOX orders only.

stockRangeLower?: number

The lower value for the acceptable underlying stock price range. For price improvement option orders on BOX and VOL orders with dynamic management.

stockRangeUpper?: number

The upper value for the acceptable underlying stock price range. For price improvement option orders on BOX and VOL orders with dynamic management.

stockRefPrice?: number

The stock's reference price. The reference price is used for VOL orders to compute the limit price sent to an exchange (whether or not Continuous Update is selected), and for price range monitoring.

sweepToFill?: boolean

If set to true, specifies that the order is a Sweep-to-Fill order.

Define the Soft Dollar Tier used for the order. Only provided for registered professional advisors and hedge and mutual funds.

The time in force.

Valid values are:

  • DAY - Valid for the day only.
  • GTC - Good until canceled. The order will continue to work within the system and in the marketplace until it executes or is canceled. GTC orders will be automatically be cancelled under the following conditions: If a corporate action on a security results in a stock split (forward or reverse), exchange for shares, or distribution of shares. If you do not log into your IB account for 90 days. At the end of the calendar quarter following the current quarter. For example, an order placed during the third quarter of 2011 will be canceled at the end of the first quarter of 2012. If the last day is a non-trading day, the cancellation will occur at the close of the final trading day of that quarter. For example, if the last day of the quarter is Sunday, the orders will be cancelled on the preceding Friday. Orders that are modified will be assigned a new “Auto Expire” date consistent with the end of the calendar quarter following the current quarter. Orders submitted to IB that remain in force for more than one day will not be reduced for dividends. To allow adjustment to your order price on ex-dividend date, consider using a Good-Til-Date/Time (GTD) or Good-after-Time/Date (GAT) order type, or a combination of the two.
  • IOC - Immediate or Cancel. Any portion that is not filled as soon as it becomes available in the market is canceled.
  • GTD. - Good until Date. It will remain working within the system and in the marketplace until it executes or until the close of the market on the date specified
  • OPG - Use OPG to send a market-on-open (MOO) or limit-on-open (LOO) order.
  • FOK - If the entire Fill-or-Kill order does not execute as soon as it becomes available, the entire order is canceled.
  • DTC - Day until Canceled
totalQuantity?: number

The number of positions being bought/sold.

trailStopPrice?: number

Trail stop price for TRAILIMIT orders.

trailingPercent?: number

Specifies the trailing amount of a trailing stop order as a percentage.

This field is mutually exclusive with the existing trailing amount. That is, the API client can send one or the other but not both.

This field is read AFTER the stop price (barrier price) as follows: deltaNeutralAuxPrice stopPrice, trailingPercent, scale order attributes

The field will also be sent to the API in the openOrder message if the API client version is >= 56. It is sent after the stopPrice field as follows: stopPrice, trailingPct, basisPoint

transmit?: boolean

Specifies whether the order will be transmitted by TWS. If set to false`, the order will be created at TWS but will not be sent.

triggerMethod?: number

Specifies how Simulated Stop, Stop-Limit and Trailing Stop orders are triggered.

Valid values are:

  • 0 - The default value. The "double bid/ask" function will be used for orders for OTC stocks and US options. All other orders will used the "last" function.
  • 1 - use "double bid/ask" function, where stop orders are triggered based on two consecutive bid or ask prices.
  • 2 - "last" function, where stop orders are triggered based on the last price.
  • 3 - double last function.
  • 4 - bid/ask function.
  • 7 - last or bid/ask function.
  • 8 - mid-point function.
triggerPrice?: number

TODO: document

usePriceMgmtAlgo?: boolean

TODO: document

volatility?: number

The option price in volatility, as calculated by TWS' Option Analytics. This value is expressed as a percent and is used to calculate the limit price sent to the exchange.

volatilityType?: number

Values include:

  • 1 - Daily Volatility
  • 2 - Annual Volatility.
whatIf?: boolean

Allows to retrieve the commissions and margin information.

When placing an order with this attribute set to `true, the order will not be placed as such. Instead it will used to request the commissions and margin information that would result from this order.

Generated using TypeDoc