• No results found

3.5 Historical Data

3.6.2 Fields in Orders

Changed: Boolean;

The Changed property is reset to false when an order status changes, but the filled quantity does not.

Completed: Boolean;

Completed is true when an order is successfully cancelled, or an order is completely filled, otherwise false. Value is set automatically from notifications from TWS (read and write). TempId: Integer;

The TempId is the identity used by TWS to identify this order. See also ClientId. (read and write).

PermId: Integer;

PermId is created by TWS, and is filled in by TIABSocket component when first discovered. (read and write).

ClientId: Integer;

ClientId that generated this Order. If the order was made from the TWS, then ClientID is 0. If you run Patterns, set ClientID to 1. You may open Patterns again, and create another order. In this case, set ClientId to 2 for the second Patterns.

Filled: Integer;

Total volume of executed filled shares / contracts for this order. Updated automatically. (read and write).

Remaining: Integer;

Remaining of open volume of shares / contracts for this order. Updated automatically. (read and write).

FillPrice: Double;

Current fill price of executed shares. This value is the average price for all fills in this order so far. Updated automatically. (read and write).

LatestFillQty: Integer;

The last number of filled shares / contracts when a partial fill occurs. Updated automatically. (read and write).

Account: string;

For institutional customers only. Account number / name. (read and write). Action: TIABAction;

TIABAction = (Idle,Buy,Sell,Short,Exercise,Lapse);

Sets the action (buy, sell, short) for this order when passed to the PlaceOrder method. For Options use the ExerciseOptions method and the action set to Exercise or Lapse. Changing this property does not send the order. (read and write).

AuxPrice: Money;

This is the STOP price for stop-limit orders, and the offset amount for Relative orders and Trail orders. In all other cases, specify zero. (read and write).

The auxprice is the amount by which IB substracts from the last price to get the stop price. If lastprice changes to 52 and your aux price is set to 1.00 - then your stop price becomes 51. If lastprice drops to 51.5 - your stop price for a sell is still 51. (51 is still higher than 50.5) If lastprice moves up to 53 - your stop price for a sell will be 53-1 = 52. (52 is higher than 51) The aux price does not shrink unless you change the order yourself. I.e. stop price does not come down for a sell order, it either goes up or you get stopped out at the last stop price. That's theory - please check it out with your paper account - I notice it sometimes doesn't work especially when it is very volatile, in particular

for futures, the price can drop drastically - don't forget the stop becomes a market order. Currency: string;

Specifies the currency. This field is only required when the SecurityType = stCash. Otherwise it is ignored. (read and write).

The order destination such as 'SMART' or 'GLOBEX'. NOTE: When you connect to TWS using any of the API components, you must route all U.S. stock and option orders through Smart order routing. (read and write).

Note: see also PrimaryExchange property. Expiry: string;

The expiration date of a Future or Option. LocalSymbol: string;

This is the local exchange symbol of the underlying asset. OCAgroup: string;

Identifies an OCA (one cancels all) group. Set this to any unique string, and all open orders with same value, will be tied together. (read and write).

OpenClose: string;

For institutional customers only. Specifies whether the order is an open or close order. Valid values are 'O', 'C'. (read and write, default = 'O').

OrderRef: string;

For institutional customers only. The order reference. (read and write). OrderOrigin: TIABOrderOrigin;

TIABOrderOrigin = (Customer,Firm,Unknown); (read and write). OrderType: TIABOrderType;

NoChange, Market,Limit, Stop,StopLimit, Relative,VWAP, MarketClose, LimitClose, Trail,LimitOpen, MarketOpen,OneCancelOrder, ISEBlock,PegMarket, Volume,TrailLimit, None,

Unknown

Use NoChange for a call to ModifyOrder only. Not all order types are supported in the API as yet.

SecurityType: TIABSecurityType;

Stock, Option,Future, Index,FutOpt, Cash,Bag, Bond Strike: Money;

For options. Symbol: string;

This is the symbol of the asset. TrailStopPrice: Money; For Trailing stop limit orders.

Use the order type of TrailLimit. When placing trailing stop limit orders, the AuxPrice property specifies the trailing amount, and the stop price is specified as this TrailStopPrice property.

TimeInForce: TIABTimeInForce;

Values are Day, GoodTilCancelled, ImmediateOrCancel(FillOrKill), opg(?), Good Till Date (read and write).

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.

ParentId: Integer;

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

If set to true, specifies that the order is an ISE Block order. SweepToFill: Boolean;

The desired futures or options contract multiplier in any API operation that involves describing a contract. These operations are: placing orders, requesting market data, requesting market depth, and requesting contract (instrument) specifications. An example of when this

functionality is useful is when a corporate action has resulted in more than one options contract being traded on the same underlying, with the same right (put or call), strike, and expiration. If a contract only trades with a single multiplier (typically 100), specifying the multiplier is not necessary.

DisplaySize: Integer;

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

ShortSaleSlot: Integer;

Retail customers set to a value of 0.

Institutional (ie non-cleared) customer specify "Short Sale Slot" information when placing an order of side "SSHORT." This information concerns the location from which shares will be delivered, and has two parameters, "Short Sale Slot" and "Designated Location." If "Short Sale Slot" is 1, then shares will be delivered from the customer's clearing firm, and no

"Designated Location" is specified. If "Short Sale Slot" is 2, then shares will be delivered from a "Designated Location" clearing firm, and the value of "Designated Location" is a

comma-delimitted list of possible firms.

TriggerMethod: Integer;

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

O - the default value. The "Money bid/ask" method will be used for orders for OTC stocks and US options. All other orders will used the "last" method.

1 - use "Money bid/ask" method, where stop orders are triggered based on two consecutive bid or ask prices.

2 - "last" method, where stop orders are triggered based on the last price.

3 - "Money-last" method, where stop orders are triggered based on last two prices. ExtendedHours: Boolean;

If set to true, allows triggering of orders outside of regular trading hours. (read and write). Hidden: Boolean;

For example, to allocate 20 shares of a 100 share order to account 'U101' and the other 80 shares to account 'U203', enter the following share allocation string: U101/20,U203/80 DiscretAmount: Money;

Field discretionaryAmt - unknown purpose? FAdvGroup: string;

For Finacial Adviser accounts, otherwise a blank string ''; FAdvMethod: string;

For Finacial Adviser accounts, otherwise a blank string ''; FAdvPercentage: string;

For Finacial Adviser accounts, otherwise a blank string ''; FAdvProfile: string;

For Finacial Adviser accounts, otherwise a blank string ''; GoodAfterTime: string;

The trade's "Good After Time," GoodTillDate: string;

The trade's "Good Till Date," PrimaryExchange: string;

Specify the PrimaryExchange for Smart Routing.

You must specify the primary exchange when placing orders routed through SMART exchange, or when making SMART market data requests. Specifying the primary exchange allows the API to resolve routing ambiguities for example in instances when an asset trades in the same currency on multiple exchanges (i.e. QQQ trades in US dollars on both AMEX and NYSE). Note that the primary exchange for NASDAQ-traded products is SUPERSOES.

Unknown... see TWS help. OcaMethod: TIABOcaMethod;

CancelWithBlock, ReduceWithBlock, ReduceNonBlock RegTradingHoursOnly: Boolean;

Rule80A: TIABRule80A;

Individual, Agency, AgentOtherMember, IndividualPTIA, AgencyPTIA, AgentOtherMemberPTIA, IndividualPT, AgencyPT, AgentOtherMemberPT OverridePercentageConstraints: Boolean;

Overrides TWS's order price percentage constraints, which are applied to orders that TWS sees as deviating too much from the NBBO of the contract. This functionality was put into place to work in conjunction with the fact that TWS will no longer pop up a confirmation dialog when an API order violates the percentage constraints TWS imposes. If this is set to false, such orders going forward will be rejected. Keep in mind that orders with prices that severely depart from the contract's NBBO but would otherwise be filled will be rejected by IB's servers.

SettlingFirm: string; Pertains to institutional only. AllOrNone: Boolean; MinQuantity: Integer; Minimum quantity. PercentOffset: Money;

Pertains to relative orders only. ETradeOnly: Boolean; FirmQuoteOnly: Boolean; Trade with firm quotes..? NBBOPriceCap: Money;

The following are for BOX orders:

All volatility orders have these two parameters:

Volatility: What the price is computed from via TWS's options analytics. For VOL orders, the

limit price sent to an exchange is not editable, as it is the output of a function. Volatility is expressed as a percentage.

VolatilityPeriod: Set to UnSet, Daily or Annual.

Dynamic volatility orders have these five additional parameters:

DeltaNeutral: Specifies whether TWS is supposed to do the corresponding delta trade upon

full or partial execution of the option order. If delta neutral is selected, market orders in the underlier will be placed in response to executions to maintain delta-neutrality.

ContinuousUpdate: Whether TWS is supposed to update the order price as the underlier

moves. If Continuous Update is selected, the limit price sent to an exchange is modified by TWS if the computed price of the option changes enough to warrant doing so. This is very helpful in keeping the limit price sent to the exchange up to date as the underlier price changes.

ReferencePrice: UnSet, Average or BidOrAsk. Set to Average for Average of National Best

Bid or Ask, or set to BidOrAsk for National Best Bid when buying a call or selling a put, and National Best Ask when selling a call or buying a put. The reference price is used to compute the limit price sent to an exchange (whether or not Continuous Update is selected), and for watermark price monitoring.

3.6.2.1 Combination

Create combination orders that include options, stock and futures legs (stock legs can be included if the order is routed through SmartRouting). Although a combination/spread order is constructed of separate legs, it is executed as a single transaction if it is routed directly to an exchange.

For combination orders that are SmartRouted, each leg may be executed separately to ensure best execution.

tab, or create an order or group of orders with a named strategy using a template, on either the Single or Multiple tab. Currently TWS provides templates to construct the following named combination strategies:

Box - An order to simultaneously purchase and sell two synthetics in identical numbers at

different strike prices. For example: Buy 1 April02 95 call, Sell 1 April02 95 put, Sell 1 April02 100 call, Buy 1 April02 100 put.

Butterfly - An order to simultaneously purchase an option with one strike price, purchase an

option with a second strike price, and sell two options with a third strike price that is midway between the prices of the first two options. The ratio for a butterfly is always 1 x 2 x 1. For example: Buy 10 March02 95 calls, Sell 20 March02 100 calls, Buy 10 March02 105 calls.

Buy Write - An order to simultaneously purchase (sell) a stock and sell (purchase) a call

option of the same underlying. Purchase a Buy Write: Sell 1 XYZ April06 95 call, Buy 100 shares XYZ Sell a Buy Write: Buy 1 XYZ April06 95 call, Sell 100 shares XYZ

Calendar spread - An order to simultaneously purchase and sell options with different

expiration dates, where both have the same underlying, right (call or put) and strike price. This spread is sometimes referred to as a time spread. A calendar spread whose options have different expiration dates and different strike prices is sometimes referred to as a diagonal spread. For example: Buy 1 June02 100 call, Sell 1 March02 100 call.

Conversion - An order to simultaneously sell (or purchase) a call option and purchase (or sell)

a put option in identical numbers where both have the same underlying, expiration date and strike price, and purchase stock of the same underlying. Purchase a conversion: Sell 1 XYZ April04 75 call, Buy 1 XYZ April04 75 put, Buy 100 shares XYZ Sell a conversion: Buy 1 XYZ April04 75 call, Sell 1 XYZ April04 75 put, Sell 100 shares XYZ

Delta Neutral - An order to simultaneously buy (or sell) options contracts and sell (or buy) a

delta amount of the underlying. The quoted price is the outright combo price minus the underlying price.

Diagonal spread - An order to simultaneously purchase and sell options with different

expiration dates and different strike prices, where both have the same underlying and right (call or put). For example: Buy 1 June03 100 call, Sell 1 Sept03 105 call.

Reversal- An order to simultaneously purchase (or sell) a call option and sell (or purchase) a

put option in identical numbers where both have the same underlying, expiration date and strike price, and sell stock of the same underlying. Purchase a reversal: Buy 1 XYZ April04 75 call, Sell 1 XYZ April04 75 put, Sell 100 shares XYZ Sell a reversal: Sell 1 XYZ April04 75 call, Buy 1 XYZ April04 75 put, Buy 100 shares XYZ

Dec02 90 call, Sell 1 Dec02 90 put.

Strangle - An order to simultaneously purchase a call and a put with different strike prices,

where both have the same underlying and expiration date. In the case where both the call and the put are out of the money, this order is referred to as an inside strangle. For example: Buy 1 June02 95 put, Buy 1 June02 105 call.

Stk/Opt - An order to simultaneously purchase (or sell) one stock contract and purchase (or

sell) one options contract. For example: Sell 1 Jan07 55.0 put, Sell 100 shares of the underlying.

Synthetic - An order to simultaneously purchase a call and sell a put in identical numbers (or

sell a call and purchase a put in identical numbers), where both have the same underlying, expiration date and strike price. Purchase a synthetic: Buy 1 April02 100 call, Sell 1 April02 100 put. Sell a synthetic: Sell 1 April02 100 call, Buy 1 April02 100 put.

Synthetic Put - An order to simultaneously purchase (or sell) a call option and sell (or

purchase) stock where both have the same underlying. Purchase a synthetic put: Buy 1 XYZ April03 75 call, Sell 100 shares XYZ Sell a synthetic put: Sell 1 XYZ April03 75 call, Buy 100 shares XYZ.

Synthetic Call - An order to simultaneously purchase (or sell) a put option and purchase (or

sell) stock where both have the same underlying. Purchase a synthetic call: Buy 1 XYZ April03 75 put, Buy 100 shares XYZ Sell a synthetic put: Sell 1 XYZ April03 75 put, Sell 100 shares XYZ.

Vertical spread - An order to simultaneously purchase and sell options at different strike

prices, where both have the same underlying, right (call or put) and expiration date. This spread is sometimes referred to as a price spread. Call vertical spread example: Buy 1 June02 100 call, Sell 1 June02 105 call. Put vertical spread example: Buy 1 March02 105 put, Sell 1 March02 95 put

For more information on combination orders and margin requirements for combination orders, see U.S. Equity Options Margin Requirements on the IB website.

different strike prices. For example: Buy 1 April02 95 call, Sell 1 April02 95 put, Sell 1 April02 100 call, Buy 1 April02 100 put.

Price Improvement Auction

For options routed through BOX, you may elect to participate in the Price Improvement Auction to better your price. You can submit nine different types of Price Improvement Auction orders by combining one of three order types (Limit, Relative, Pegged to Stock) with one of three Auction Strategies (Match, Improve, Transparent) described below.

To submit a Price Improvement Auction order Create an options order routed to BOX.

In the Type field, select either LMT, REL, or PEG STK.

For Limit orders, enter the limit price in the LmtPrice field in penny increments.

For Relative orders, set a relative offset amount (in penny increments) in the AuxPrice field. For PEG STK orders, you enter the starting price in the AuxPrice field, auction strategy in the AucStrat field, the delta in the Delta field, the optional stock reference price in the

StockRefPrice field, the low side of the optional stock range in the StockRangeLow field, the

high side of the optional stock range in the StockRangeHigh field. In the AucStrat field, select from one of three strategies:

Match - matches the current auction price, but will not exceed the calculated price

improvement amount.

Improve - enters a bid higher (for SELL order) or lower (for BUY order) than the current

auction price, but will not exceed the calculated price improvement amount.

Transparent - enters a price that includes the full calculated price improvement amount.

3.6.2.2.1 Fields for Box

For a Box trade, there are additional fields not present in a non-Box trade. AuctionStrategy StartingPrice StockRangeUpper StockRangeLower Delta StockRefPrice Volatility VolatilityPeriod DeltaNeutralOrderType DeltaNeutralAuxPrice ContinuousUpdate

Dynamic volatility orders have these three additional parameters:

1. DeltaNeutral: Specifies whether TWS is supposed to do the corresponding delta trade upon full or partial execution of the option order. If delta neutral is selected, market orders in the underlier will be placed in response to executions to maintain delta-neutrality.

2. ContinuousUpdate: Whether TWS is supposed to update the order price as the underlier moves. If Continuous Update is selected, the limit price sent to an exchange is modified by TWS if the computed price of the option changes enough to warrant doing so. This is very helpful in keeping the limit price sent to the exchange up to date as the underlier price changes.

3. ReferencePrice: UnSet, Average or BidOrAsk. Set to Average for Average of National Best Bid or Ask, or set to BidOrAsk for National Best Bid when buying a call or selling a put, and National Best Ask when selling a call or buying a put. The reference price is used to compute the limit price sent to an exchange (whether or not Continuous Update is selected), and for watermark price monitoring.

Related documents