-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
order.ts
764 lines (621 loc) · 25.3 KB
/
order.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
import { SoftDollarTier } from "../data/container/soft-dollar-tier";
import { TagValue } from "../data/container/tag-value";
import { OrderCondition } from "./condition/order-condition";
import { OrderAction } from "./enum/order-action";
import { OrderType } from "./enum/orderType";
import { TimeInForce } from "./enum/tif";
import { OrderComboLeg } from "./orderComboLeg";
/**
* The order's description.
*/
export interface Order {
/** The API client's order id. */
orderId?: number;
/** TODO document */
solicited?: boolean;
/** The API client id which placed the order. */
clientId?: number;
/** The Host order identifier. */
permId?: number;
/**
* 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.
*/
action?: OrderAction;
/** The number of positions being bought/sold. */
totalQuantity?: number;
/** The order's type. */
orderType?: OrderType;
/**
* 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.
*/
lmtPrice?: number;
/** Generic field to contain the stop price for STP LMT orders, trailing amount, etc. */
auxPrice?: number;
/**
* 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
*/
tif?: TimeInForce;
/** One-Cancels-All group identifier. */
ocaGroup?: string;
/**
* 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.
*/
ocaType?: number;
/**
* 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.
*/
orderRef?: string;
/**
* 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.
*/
transmit?: boolean;
/** The order ID of the parent order, used for bracket and auto trailing stop orders. */
parentId?: number;
/** If set to `true`, specifies that the order is an ISE Block order. */
blockOrder?: boolean;
/** If set to `true`, specifies that the order is a Sweep-to-Fill order. */
sweepToFill?: boolean;
/** The publicly disclosed order size, used when placing Iceberg orders. */
displaySize?: 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.
*/
triggerMethod?: number;
/** If set to `true`, allows orders to also trigger or fill outside of regular trading hours. */
outsideRth?: 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.
*/
hidden?: boolean;
/**
* Specifies the date and time after which the order will be active.
* Format: yyyymmdd hh:mm:ss {optional Timezone}.
*/
goodAfterTime?: 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)".
*/
goodTillDate?: string;
/**
* 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`.
*/
overridePercentageConstraints?: boolean;
/**
* Possible values:
* - Individual = 'I'
* - Agency = 'A'
* - AgentOtherMember = 'W'
* - IndividualPTIA = 'J'
* - AgencyPTIA = 'U'
* - AgentOtherMemberPTIA = 'M'
* - IndividualPT = 'K'
* - AgencyPT = 'Y'
* - AgentOtherMemberPT = 'N'
*/
rule80A?: string;
/** Indicates whether or not all the order has to be filled on a single execution. */
allOrNone?: boolean;
/** Identifies a minimum quantity order type. */
minQty?: number;
/** The percent offset amount for relative orders. */
percentOffset?: number;
/** Trail stop price for TRAILIMIT orders. */
trailStopPrice?: 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
*/
trailingPercent?: number;
/** The Financial Advisor group the trade will be allocated to. Use an empty string if not applicable. */
faGroup?: string;
/** @deprecated The Financial Advisor allocation profile the trade will be allocated to. Use an empty string if not applicable. */
faProfile?: string;
/** The Financial Advisor allocation method the trade will be allocated to. Use an empty string if not applicable.FaMethod */
faMethod?: string;
/** The Financial Advisor percentage concerning the trade's allocation. Use an empty string if not applicable. */
faPercentage?: 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.
*/
openClose?: string;
/**
* 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).
*/
origin?: number;
/**
* For institutions only.
* Valid values are:
* - 1 - broker holds shares.
* - 2 - shares come from elsewhere.
*/
shortSaleSlot?: number;
/**
* 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).
*/
designatedLocation?: string;
/** Only available with IB Execution-Only accounts with applicable securities Mark order as exempt from short sale uptick rule. */
exemptCode?: number;
/** The amount off the limit price allowed for discretionary orders. */
discretionaryAmt?: number;
/** Trade with electronic quotes. */
eTradeOnly?: boolean;
/** Trade with firm quotes. */
firmQuoteOnly?: boolean;
/** Maximum smart order distance from the NBBO. */
nbboPriceCap?: number;
/**
* 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.
*/
optOutSmartRouting?: boolean;
/**
* For BOX orders only.
*
* Possible values:
* - 1 - match
* - 2 - improvement
* - 3 - transparent
*/
auctionStrategy?: number;
/** The auction's starting price. For BOX orders only. */
startingPrice?: 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.
*/
stockRefPrice?: number;
/** The stock's Delta. For orders on BOX only. */
delta?: number;
/**
* The lower value for the acceptable underlying stock price range.
* For price improvement option orders on BOX and VOL orders with dynamic management.
*/
stockRangeLower?: number;
/**
* The upper value for the acceptable underlying stock price range.
* For price improvement option orders on BOX and VOL orders with dynamic management.
*/
stockRangeUpper?: 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.
*/
volatility?: number;
/**
* Values include:
* - 1 - Daily Volatility
* - 2 - Annual Volatility.
*/
volatilityType?: number;
/**
* Specifies whether TWS will automatically update the limit price of the order as the underlying price moves.
*
* VOL orders only.
*/
continuousUpdate?: 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.
*/
referencePriceType?: number;
/**
* 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.
*/
deltaNeutralOrderType?: string;
/**
* 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.
*/
deltaNeutralAuxPrice?: number;
/** TODO document */
deltaNeutralConId?: number;
/** TODO document */
deltaNeutralSettlingFirm?: string;
/** TODO document */
deltaNeutralClearingAccount?: string;
/** TODO document */
deltaNeutralClearingIntent?: 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. */
deltaNeutralOpenClose?: string;
/** Used when the hedge involves a stock and indicates whether or not it is sold short. */
deltaNeutralShortSale?: boolean;
/**
* 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]].
*/
deltaNeutralShortSaleSlot?: number;
/** Used only when [[deltaNeutralShortSaleSlot]] = 2. */
deltaNeutralDesignatedLocation?: string;
/** TODO document. For EFP orders only. */
basisPoints?: number;
/** TODO document. For EFP orders only. */
basisPointsType?: number;
/**
* Defines the size of the first, or initial, order component.
*
* For Scale orders only.
*/
scaleInitLevelSize?: number;
/**
* Defines the order size of the subsequent scale order components.
*
* For Scale orders only. Used in conjunction with scaleInitLevelSize().
*/
scaleSubsLevelSize?: number;
/**
* Defines the price increment between scale components.
*
* For Scale orders only. This value is compulsory.
*/
scalePriceIncrement?: number;
/** TODO document. For extended Scale orders. */
scalePriceAdjustValue?: number;
/** TODO document. For extended Scale orders. */
scalePriceAdjustInterval?: number;
/** TODO document. For extended Scale orders. */
scaleProfitOffset?: number;
/** TODO document. For extended Scale orders. */
scaleAutoReset?: boolean;
/** TODO document. For extended Scale orders. */
scaleInitPosition?: number;
/** TODO document. For extended Scale orders. */
scaleInitFillQty?: number;
/** TODO document. For extended Scale orders. */
scaleRandomPercent?: boolean;
/**
* For hedge orders.
*
* Possible values include:
* - D - delta
* - B - beta
* - F - FX
* - P - Pair
*/
hedgeType?: string;
/** Beta = x for Beta hedge orders, ratio = y for Pair hedge order */
hedgeParam?: string;
/** The account the trade will be allocated to. */
account?: string;
/**
* Institutions only.
*
* Indicates the firm which will settle the trade.
*/
settlingFirm?: string;
/**
* Specifies the true beneficiary of the order.
*
* For IBExecution customers.
*
* This value is required for FUT/FOP orders for reporting to the exchange.
*/
clearingAccount?: 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).
*/
clearingIntent?: 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.
*/
algoStrategy?: string;
/**
* 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.
*/
algoParams?: TagValue[];
/**
* 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.
*/
whatIf?: boolean;
/** TODO document. */
algoId?: string;
/**
* 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.
*/
notHeld?: boolean;
/**
* 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
*/
smartComboRoutingParams?: TagValue[];
/**
* 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.
*/
orderComboLegs?: OrderComboLeg[];
/** TODO document */
orderMiscOptions?: TagValue[];
/** For GTC orders. */
activeStartTime?: TagValue[];
/** For GTC orders. */
activeStopTime?: TagValue[];
/** Used for scale orders. */
scaleTable?: string;
/* The model code. */
modelCode?: 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. */
extOperator?: string;
/** Define the Soft Dollar Tier used for the order. Only provided for registered professional advisors and hedge and mutual funds. */
softDollarTier?: SoftDollarTier;
/** The native cash quantity. */
cashQty?: number;
/**
* 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+.
*/
mifid2DecisionMaker?: 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+.
*/
mifid2DecisionAlgo?: string;
/**
* For MiFID 2 reporting; identifies a person as the responsible party for the execution of a transaction within the firm.
*
* Requires TWS 969+.
*/
mifid2ExecutionTrader?: string;
/**
* For MiFID 2 reporting; identifies the algorithm responsible for the execution of a transaction within the firm.
*
* Requires TWS 969+.
*/
mifid2ExecutionAlgo?: string;
/** Don't use auto price for hedge. */
dontUseAutoPriceForHedge?: boolean;
/** TODO: document */
autoCancelDate?: string;
/** TODO: document */
filledQuantity?: number;
/** TODO: document */
refFuturesConId?: number;
/** TODO: document */
autoCancelParent?: boolean;
/** TODO: document */
shareholder?: string;
/** TODO: document */
imbalanceOnly?: boolean;
/** TODO: document */
routeMarketableToBbo?: boolean;
/** TODO: document */
parentPermId?: number;
/** TODO: document */
randomizeSize?: boolean;
/** TODO: document */
randomizePrice?: boolean;
/** Pegged-to-benchmark orders: this attribute will contain the conId of the contract against which the order will be pegged. */
referenceContractId?: number;
/** Pegged-to-benchmark orders: indicates whether the order's pegged price should increase or decreases. */
isPeggedChangeAmountDecrease?: boolean;
/** Pegged-to-benchmark orders: amount by which the order's pegged price should move. */
peggedChangeAmount?: number;
/** Pegged-to-benchmark orders: the amount the reference contract needs to move to adjust the pegged order. */
referenceChangeAmount?: number;
/** Pegged-to-benchmark orders: the exchange against which we want to observe the reference contract. */
referenceExchangeId?: string;
/** Adjusted Stop orders: the parent order will be adjusted to the given type when the adjusted trigger price is penetrated. */
adjustedOrderType?: string;
/** TODO: document */
triggerPrice?: number;
/** TODO: document */
lmtPriceOffset?: number;
/** Adjusted Stop orders: specifies the stop price of the adjusted (STP) parent. */
adjustedStopPrice?: number;
/** Adjusted Stop orders: specifies the stop limit price of the adjusted (STPL LMT) parent. */
adjustedStopLimitPrice?: number;
/** Adjusted Stop orders: specifies the trailing amount of the adjusted (TRAIL) parent. */
adjustedTrailingAmount?: number;
/** Adjusted Stop orders: specifies where the trailing unit is an amount (set to 0) or a percentage (set to 1) */
adjustableTrailingUnit?: number;
/** Conditions determining when the order will be activated or canceled. */
conditions?: OrderCondition[];
/** Indicates whether or not conditions will also be valid outside Regular Trading Hours. */
conditionsIgnoreRth?: boolean;
/** Conditions can determine if an order should become active or canceled. */
conditionsCancelOrder?: boolean;
/** Define the Soft Dollar Tier used for the order. Only provided for registered professional advisors and hedge and mutual funds. */
tier?: SoftDollarTier;
/** Set to `true` to create tickets from API orders when TWS is used as an OMS. */
isOmsContainer?: boolean;
/** Set to `true` to convert order of type 'Primary Peg' to 'D-Peg'. */
discretionaryUpToLimitPrice?: boolean;
/** TODO: document */
usePriceMgmtAlgo?: boolean;
/** Specifies the duration of the order. Format: yyyymmdd hh:mm:ss TZ. For GTD orders. */
duration?: 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. */
postToAts?: number;
/** Accepts a list with parameters obtained from advancedOrderRejectJson */
advancedErrorOverride?: 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. */
manualOrderTime?: string;
/** Defines the minimum trade quantity to fill. For IBKRATS orders. */
minTradeQty?: number;
/** Defines the minimum size to compete. For IBKRATS orders. */
minCompeteSize?: number;
/** Specifies the offset Off The Midpoint that will be applied to the order. For IBKRATS orders. */
competeAgainstBestOffset?: 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. */
midOffsetAtWhole?: 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. */
midOffsetAtHalf?: number;
}
export const COMPETE_AGAINST_BEST_OFFSET_UP_TO_MID = Infinity;
export default Order;