Introduction

View as MarkdownOpen in Claude
NameTypeDescription
AccountstringThe account the trade will be allocated to.
ActionstringIdentifies the side. Generally available values are BUY and SELL. Additionally, <b>SSHORT</b> and <b>SLONG</b> are available in some institutional-accounts only.
ActiveStartTime = new List()stringDefines the start time of GTC orders.
ActiveStopTimestringDefines the stop time of GTC orders.
AdjustableTrailingUnitintAdjusted Stop orders: specifies where the trailing unit is an amount (set to 0) or a percentage (set to 1)
AdjustedOrderTypestringAdjusted Stop orders: the parent order will be adjusted to the given type when the adjusted trigger price is penetrated.
AdjustedStopLimitPricedoubleAdjusted Stop orders: specifies the stop limit price of the adjusted (STPL LMT) parent.
AdjustedStopPricedoubleAdjusted Stop orders: specifies the stop price of the adjusted (STP) parent.
AdjustedTrailingAmountdoubleAdjusted Stop orders: specifies the trailing amount of the adjusted (TRAIL) parent.
AdvancedErrorOverridestringAccepts a string with parameters obtained from advancedOrderRejectJson.
AlgoIdstringIdentifies orders generated by algorithmic trading.
AlgoParamsListThe list of parameters for the IB algorithm. For more information about IB’s API algorithms
AlgoStrategystringThe algorithm strategy. 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
AllOrNoneboolIndicates whether or not all the order has to be filled on a single execution.
AuctionStrategyintFor BOX orders only. Values include: 1 – Match 2 – Improvement 3 – Transparent.
AutoCancelDatestringSpecifies the date to auto cancel the order.
AutoCancelParentboolCancels the parent order if child order was cancelled.
AuxPricedoubleGeneric field to contain the stop price for STP LMT orders, trailing amount, etc.
BasisPointsdoubleSpecifies Basis Points for EFP order. The values increment in 0.01% = 1 basis point. For EFP orders only.
BasisPointsTypeintSpecifies the increment of the Basis Points. For EFP orders only.
BlockOrderboolIf set to true
CashQtydoubleThe native cash quantity.
ClearingAccountstringSpecifies the true beneficiary of the order. For IBExecution customers. This value is required for FUT/FOP orders for reporting to the exchange.
ClearingIntentstringFor execution-only clients to know where do they want their shares to be cleared at. Valid values are: IB
ClientIdintThe API client id which placed the order.
CompeteAgainstBestOffsetdoubleDpecifies the offset Off The Midpoint that will be applied to the order. For IBKRATS orders.
ConditionsListConditions determining when the order will be activated or canceled.
ConditionsCancelOrderboolConditions can determine if an order should become active or canceled.
ConditionsIgnoreRthboolIndicates whether or not conditions will also be valid outside Regular Trading Hours.
ContinuousUpdateintSpecifies whether TWS will automatically update the limit price of the order as the underlying price moves. VOL orders only.
DeactivateBooleanDetermines if the order is Active (False) or Deactivated (True). Orders that are deactivated are not submitted and will not execute, though they can be reviewed and transmitted via API, Trader Workstation, or Client Portal. This is unique from the Transmit field as orders submitted as Transmit=False will not leave the current TWS instance, and will be erased upon logout. Deactivated orders will persist internally at Interactive Brokers.
DeltadoubleThe stock’s Delta. For orders on BOX only.
DeltaNeutralAuxPricedoubleUse this field to enter a value if the value in the deltaNeutralOrderType field is an order type that requires an Aux price
DeltaNeutralClearingAccountstringSpecifies the beneficiary of the Delta Neutral order.
DeltaNeutralClearingIntentstringSpecifies where the clients want their shares to be cleared at. Must be specified by execution-only clients. Valid values are: IB
DeltaNeutralConIdintThe unique contract identifier specifying the security in Delta Neutral order.
DeltaNeutralDesignatedLocationstringIdentifies third party order origin. Used only when deltaNeutralShortSaleSlot = 2.
DeltaNeutralOpenClosestringSpecifies 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.
DeltaNeutralOrderTypestringEnter 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
DeltaNeutralSettlingFirmstringIndicates the firm which will settle the Delta Neutral trade. Institutions only.
DeltaNeutralShortSaleboolUsed when the hedge involves a stock and indicates whether or not it is sold short.
DeltaNeutralShortSaleSlotintIndicates a short sale Delta Neutral order. Has a value of 1 (the clearing broker holds shares) or 2 (delivered from a third party). If you use 2
DesignatedLocationstringFor 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).
DiscretionaryAmtdoubleThe amount off the limit price allowed for discretionary orders.
DiscretionaryUpToLimitPriceboolSet to true to convert order of type ‘Primary Peg’ to ‘D-Peg’.
DisplaySizeintThe publicly disclosed order size
DontUseAutoPriceForHedgeboolDon’t use auto price for hedge.
DurationintSpecifies the number of seconds the order should remain active. For GTD orders only. Users that would prefer to specify an exact date should user the “GoodTillDate” parameter instead. Both values cannot be specified at the same time.
ExemptCodeintOnly available with IB Execution-Only accounts with applicable securities. Mark order as exempt from short sale uptick rule.
ExtOperatorStringFollowing CME Rule 576, the ExtOperator field will signify if the unique API operator at the time of trading for order management.
FaGroupstringThe Financial Advisor group the trade will be allocated to. Use an empty string if not applicable.
FaMethodstringThe Financial Advisor allocation method the trade will be allocated to. Use an empty string if not applicable.
FaPercentagestringThe Financial Advisor percentage concerning the trade’s allocation. Use an empty string if not applicable.
FilledQuantitydecimalSpecifies the initial order quantity to be filled.
GoodAfterTimestringSpecifies the date and time after which the order will be active. Format: yyyymmdd hh:mm:ss {optional Timezone}.
GoodTillDatestringThe date and time when the order should cancel if not already filled. Only valid for orders using the “GTD” tif. Users that would prefer to specify a number of seconds should use the Duration parameter instead. Both values cannot be specified at the same time.
HedgeMaxSizeintegerhedgeMaxSize (also referred to as “Max Hedging Size”) is a user-supplied parameter that caps the maximum number of shares that can be shorted in a beta hedge child order. It provides an upper bound for risk and credit assessment purposes. Applied only to beta hedge orders (sell side only) for stocks in IB- cleared accounts.
HedgeParamstringFor hedge orders. Beta = x for Beta hedge orders
HedgeTypestringFor hedge orders. Possible values include: D – Delta B – Beta F – FX P – Pair
HiddenboolIf set to true, the order will not be visible when viewing the market depth. This option only applies to orders routed to the NASDAQ exchange.
ImbalanceOnlyboolUsed to specify “imbalance only open orders” or “imbalance only closing orders”.
includeOvernightboolSpecify if the order should include overnight trading or not. False (no Overnight) is set by default.
IsOmsContainerboolSet to true to create tickets from API orders when TWS is used as an OMS.
IsPeggedChangeAmountDecreaseboolPegged-to-benchmark orders: indicates whether the order’s pegged price should increase or decreases.
LmtPricedoubleThe LIMIT price. Used for limit
LmtPriceOffsetdoubleAdjusted Stop orders: specifies the price offset for the stop to move in increments.
ManualOrderIndicatorintFollowing CME Rule 576, the ManualOrderIndicator field will signify if an order is manual (1) or automated (0).
ManualOrderTimestringUsed by brokers and advisors when manually entering an order request. Format should be “YYYYMMDD-HH:mm:ss” using UTC as the timezone value.
MidOffsetAtHalfdoubleThis offset is applied when the spread is an odd number of cents wide. This offset must be in half-penny increments. For IBKRATS orders.
MidOffsetAtWholedoubleThis 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.
Mifid2DecisionAlgostringIdentifies the algorithm responsible for investment decisions within the firm. Orders covered under MiFID 2 must include either Mifid2DecisionMaker or Mifid2DecisionAlgo
Mifid2DecisionMakerstringIdentifies 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+.
Mifid2ExecutionAlgostringFor MiFID 2 reporting; identifies the algorithm responsible for the execution of a transaction within the firm. Requires TWS 969+.
Mifid2ExecutionTraderstringFor MiFID 2 reporting; identifies a person as the responsible party for the execution of a transaction within the firm. Requires TWS 969+.
MinCompeteSizeintDefines the minimum size to compete. For IBKRATS orders.
MinQtyintIdentifies a minimum quantity order type.
MinTradeQtyintDefines the minimum trade quantity to fill. For IBKRATS orders.
ModelCodestringIs used to place an order to a model. For example
NotHeldboolOrders routed to IBDARK are tagged as “post only” and are held in IB’s order book
OcaGroupstringOne-Cancels-All group identifier.
OcaTypeintTells 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.
OpenClosestringFor institutional customers only. Valid values are O (open) and 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.
OptOutSmartRoutingboolUse 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
OrderComboLegsListList of Per-leg price following the same sequence combo legs are added. The combo price must be left unspecified when using per-leg prices.
OrderIdintThe API client’s order id.
OrderMiscOptions = new List()ListFor internal use only. Use the default value XYZ.
OrderRefstringThe order reference. Intended for institutional customers only
OrderTypestringThe order’s type.
OriginintThe 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.
OutsideRthboolIf set to true, allows orders to also trigger or fill outside of regular trading hours.
OverridePercentageConstraintsboolOverrides TWS constraints. Precautionary constraints are defined on the TWS Presets page
ParentIdintThe order ID of the parent order, used for bracket and auto trailing stop orders.
ParentPermIdlongParent order Id.
PeggedChangeAmountdoublePegged-to-benchmark orders: amount by which the order’s pegged price should move.
PercentOffsetdoubleThe percent offset amount for relative orders.
PermIdintThe Host order identifier.
PostToAtsintValue must be positive
PtOrderIdintOrder ID for a preset profit taker order.
PtOrderTypestringOrder type for the profit take. Must be “PRESET”.
RandomizePriceboolRandomizes the order’s price. Only for Volatility and Pegged to Volatility orders.
RandomizeSizeboolRandomizes the order’s size. Only for Volatility and Pegged to Volatility orders.
RefFuturesConIdintIdentifies the reference future conId.
ReferenceChangeAmountdoublePegged-to-benchmark orders: the amount the reference contract needs to move to adjust the pegged order.
ReferenceContractIdintPegged-to-benchmark orders: this attribute will contain the conId of the contract against which the order will be pegged.
ReferenceExchangestringPegged-to-benchmark orders: the exchange against which we want to observe the reference contract.
ReferencePriceTypeintSpecifies how you want TWS to calculate the limit price for options
RouteMarketableToBboboolRoutes market order to Best Bid Offer.
Rule80AstringIndividual = ‘I’ Agency = ‘A’ AgentOtherMember = ‘W’ IndividualPTIA = ‘J’ AgencyPTIA = ‘U’ AgentOtherMemberPTIA = ‘M’ IndividualPT = ‘K’ AgencyPT = ‘Y’ AgentOtherMemberPT = ‘N’.
ScaleAutoResetboolRestarts the Scale series if the order is cancelled. For extended scale orders.
ScaleInitFillQtyintSpecifies the initial quantity to be filled. For extended scale orders.
ScaleInitLevelSizeintDefines the size of the first
ScaleInitPositionintThe initial position of the Scale order. For extended scale orders.
ScalePriceAdjustIntervalintSpecifies the interval when the price is adjusted. For extended Scale orders.
ScalePriceAdjustValuedoubleModifies the value of the Scale order. For extended Scale orders.
ScalePriceIncrementdoubleDefines the price increment between scale components. For Scale orders only. This value is compulsory.
ScaleProfitOffsetdoubleSpecifies the offset when to adjust profit. For extended scale orders.
ScaleRandomPercentboolDefines the random percent by which to adjust the position. For extended scale orders.
ScaleSubsLevelSizeintDefines the order size of the subsequent scale order components. For Scale orders only. Used in conjunction with scaleInitLevelSize().
ScaleTablestringThe list of scale orders. Used for scale orders.
SettlingFirmstringIndicates the firm which will settle the trade. Institutions only.
ShareholderstringIdentifies the Shareholder.
ShortSaleSlotintFor institutions only. Valid values are: 1 – Broker holds shares 2 – Shares come from elsewhere.
---------
SlOrderIdintOrder identifier of the attached stop loss from presets.
SlOrderTypestringOrder type for the attach stop loss from presets. Must be “PRESET”.
SmartComboRoutingParamsListAdvanced parameters for Smart combo routing. These features are for both guaranteed and nonguaranteed combination orders routed to Smart
SolicitedboolThe Solicited field should be used for orders initiated or recommended by the broker or adviser that were approved by the client (by phone, email, chat, verbally, etc.) prior to entry. Please note that orders that the adviser or broker placed without specifically discussing with the client are discretionary orders, not solicited.
StartingPricedoubleThe auction’s starting price. For BOX orders only.
StockRangeLowerdoubleThe lower value for the acceptable underlying stock price range. For price improvement option orders on BOX and VOL orders with dynamic management.
StockRangeUpperdoubleThe upper value for the acceptable underlying stock price range. For price improvement option orders on BOX and VOL orders with dynamic management.
StockRefPricedoubleThe 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)
SweepToFillboolIf set to true
TierSoftDollarTierDefine the Soft Dollar Tier used for the order. Only provided for registered professional advisors and hedge and mutual funds.
TifstringThe 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)
TotalQuantitydecimalThe number of positions being bought/sold.
TrailStopPricedoubleTrail stop price for TRAIL LIMIT orders.
TrailingPercentdoubleSpecifies the trailing amount of a trailing stop order as a percentage. Observe the following guidelines when using the trailingPercent field: Guidelines * 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.
TransmitboolSpecifies whether the order will be transmitted by TWS. If set to false, the order will be created at TWS but will not be sent. Users implementing directly from Protobuf should be aware that Transmit should be implicitly set to ‘true’ when placing orders to transmit an order.
TriggerMethodintSpecifies how Simulated Stop
TriggerPricedoubleAdjusted Stop orders: specifies the trigger price to execute.
UsePriceMgmtAlgoboolSpecifies wether to use Price Management Algo. CTCI users only.
VolatilitydoubleThe option price in volatility
VolatilityTypeintValues include: 1 – Daily Volatility 2 – Annual Volatility.
WhatIfboolAllows to retrieve the commissions and margin information. When placing an order with this attribute set to true
customerAccountStringRequired for Nondisclosed Omnibus Accounts. A unique identifier for each account within the Omnibus structure to signify the account holder being traded. Best practice (Not Required): clients should look to hash this value, using something along the lines of 5 digits of SHA1 of the account number. This should not be implemented for non-omnibus accounts.
isProCustomerBooleanRequired for Nondisclosed Omnibus Accounts Signify whether or not the subaccount is classified as Professional or Non-Professional. This should not be implemented for non-omnibus accounts.