/* Copyright (C) 2019 Interactive Brokers LLC. All rights reserved. This code is subject to the terms
* and conditions of the IB API Non-Commercial License or the IB API Commercial License, as applicable. */
using System;
using System.Collections.Generic;
namespace IBApi
{
/**
* @class Order
* @brief The order's description.
* @sa Contract, OrderComboLeg, OrderState
*/
public class Order
{
public static int CUSTOMER = 0;
public static int FIRM = 1;
public static char OPT_UNKNOWN = '?';
public static char OPT_BROKER_DEALER = 'b';
public static char OPT_CUSTOMER = 'c';
public static char OPT_FIRM = 'f';
public static char OPT_ISEMM = 'm';
public static char OPT_FARMM = 'n';
public static char OPT_SPECIALIST = 'y';
public static int AUCTION_MATCH = 1;
public static int AUCTION_IMPROVEMENT = 2;
public static int AUCTION_TRANSPARENT = 3;
public static string EMPTY_STR = "";
public static double COMPETE_AGAINST_BEST_OFFSET_UP_TO_MID = double.PositiveInfinity;
// main order fields
// extended order fields
// "Time in Force" - DAY, GTC, etc.
// GTC orders
// one cancels all group name
// 1 = CANCEL_WITH_BLOCK, 2 = REDUCE_WITH_BLOCK, 3 = REDUCE_NON_BLOCK
// if false, order will be created but not transmitted
// Parent order Id, to associate Auto STP or TRAIL orders with the original order.
// 0=Default, 1=Double_Bid_Ask, 2=Last, 3=Double_Last, 4=Bid_Ask, 7=Last_or_Bid_Ask, 8=Mid-point
// FORMAT: 20060505 08:00:00 {time zone}
// FORMAT: 20060505 08:00:00 {time zone}
// Individual = 'I', Agency = 'A', AgentOtherMember = 'W', IndividualPTIA = 'J', AgencyPTIA = 'U', AgentOtherMemberPTIA = 'M', IndividualPT = 'K', AgencyPT = 'Y', AgentOtherMemberPT = 'N'
// REL orders only
// for TRAILLIMIT orders only
// Financial advisors only
// Institutional orders only
// O=Open, C=Close
// 0=Customer, 1=Firm
// 1 if you hold the shares, 2 if they will be delivered from elsewhere. Only for Action="SSHORT
// set when slot=2 only.
// SMART routing only
// BOX or VOL ORDERS ONLY
// 1=AUCTION_MATCH, 2=AUCTION_IMPROVEMENT, 3=AUCTION_TRANSPARENT
// BOX ORDERS ONLY
// pegged to stock or VOL orders
// VOLATILITY ORDERS ONLY
// 1=daily, 2=annual
// 1=Average, 2 = BidOrAsk
// COMBO ORDERS ONLY
// EFP orders only
// EFP orders only
// SCALE ORDERS ONLY
// HEDGE ORDERS ONLY
// 'D' - delta, 'B' - beta, 'F' - FX, 'P' - pair
// beta value for beta hedge, ratio for pair hedge
// Clearing info
// True beneficiary of the order
// "" (Default), "IB", "Away", "PTA" (PostTrade)
// ALGO ORDERS ONLY
// What-if
//algoId
// Not Held
// Smart combo routing params
// order combo legs
// native cash quantity
// don't use auto price for hedge
/**
* @brief The API client's order id.
*/
public int OrderId { get; set; }
/**
* @brief The 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.
*/
public bool Solicited { get; set; }
/**
* @brief The API client id which placed the order.
*/
public int ClientId { get; set; }
/**
* @brief The Host order identifier.
*/
public int PermId { get; set; }
/**
* @brief Identifies the side. \n
* Generally available values are BUY and SELL. \n
* Additionally, SSHORT and SLONG are available in some institutional-accounts only. \n
* 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. \n
* SSHORT is only supported for institutional account configured with Long/Short account segments or clearing with a separate account. \n
* SLONG is available in specially-configured institutional accounts to indicate that long position not yet delivered is being sold.
*/
public string Action { get; set; }
/**
* @brief The number of positions being bought/sold.
*/
public decimal TotalQuantity { get; set; }
/**
* @brief The order's type.
*/
public string OrderType { get; set; }
/**
* @brief The LIMIT price. \n
* Used for limit, stop-limit and relative orders. In all other cases specify zero. For relative orders with no limit price, also specify zero.
*/
public double LmtPrice { get; set; }
/**
* @brief Generic field to contain the stop price for STP LMT orders, trailing amount, etc.
*/
public double AuxPrice { get; set; }
/**
* @brief The time in force.\n
* Valid values are: \n
* DAY - Valid for the day only.\n
* 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: \n
* \t\t If a corporate action on a security results in a stock split (forward or reverse), exchange for shares, or distribution of shares.
* \t\t If you do not log into your IB account for 90 days. \n
* \t\t 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.\n
* \t\t Orders that are modified will be assigned a new “Auto Expire” date consistent with the end of the calendar quarter following the current quarter.\n
* \t\t 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.\n
* IOC - Immediate or Cancel. Any portion that is not filled as soon as it becomes available in the market is canceled.\n
* 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\n
* OPG - Use OPG to send a market-on-open (MOO) or limit-on-open (LOO) order.\n
* FOK - If the entire Fill-or-Kill order does not execute as soon as it becomes available, the entire order is canceled.\n
* DTC - Day until Canceled.
*/
public string Tif { get; set; }
/**
* @brief One-Cancels-All group identifier.
*/
public string OcaGroup { get; set; }
/**
* @brief Tells how to handle remaining orders in an OCA group when one order or part of an order executes.\n
* Valid values are:\n
* \t\t 1 - Cancel all remaining orders with block.\n
* \t\t 2 - Remaining orders are proportionately reduced in size with block.\n
* \t\t 3 - Remaining orders are proportionately reduced in size with no block.\n
* 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.
*/
public int OcaType { get; set; }
/**
* @brief The order reference. \n
* 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.
*/
public string OrderRef { get; set; }
/**
* @brief 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.
*/
public bool Transmit { get; set; }
/**
* @brief The order ID of the parent order, used for bracket and auto trailing stop orders.
*/
public int ParentId { get; set; }
/**
* @brief If set to true, specifies that the order is an ISE Block order.
*/
public bool BlockOrder { get; set; }
/**
* @brief If set to true, specifies that the order is a Sweep-to-Fill order.
*/
public bool SweepToFill { get; set; }
/**
* @brief The publicly disclosed order size, used when placing Iceberg orders.
*/
public int DisplaySize { get; set; }
/**
* @brief Specifies how Simulated Stop, Stop-Limit and Trailing Stop orders are triggered.\n
* Valid values are:\n
* 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.\n
* 1 - use "double bid/ask" function, where stop orders are triggered based on two consecutive bid or ask prices.\n
* 2 - "last" function, where stop orders are triggered based on the last price.\n
* 3 - double last function.\n
* 4 - bid/ask function.\n
* 7 - last or bid/ask function.\n
* 8 - mid-point function.
*/
public int TriggerMethod { get; set; }
/**
* @brief If set to true, allows orders to also trigger or fill outside of regular trading hours.
*/
public bool OutsideRth { get; set; }
/**
* @brief If 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.
*/
public bool Hidden { get; set; }
/**
* @brief Specifies the date and time after which the order will be active.\n
* Format: yyyymmdd hh:mm:ss {optional Timezone}
*/
public string GoodAfterTime { get; set; }
/**
* @brief The date and time until the order will be active.\n
* 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)" or UTC "yyyyMMdd-HH:mm:ss"
*/
public string GoodTillDate { get; set; }
/**
* @brief Overrides TWS constraints.\n
* Precautionary constraints are defined on the TWS Presets page, and help ensure tha tyour 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.
*/
public bool OverridePercentageConstraints { get; set; }
/**
* @brief
* Individual = 'I'\n
* Agency = 'A'\n
* AgentOtherMember = 'W'\n
* IndividualPTIA = 'J'\n
* AgencyPTIA = 'U'\n
* AgentOtherMemberPTIA = 'M'\n
* IndividualPT = 'K'\n
* AgencyPT = 'Y'\n
* AgentOtherMemberPT = 'N'
*/
public string Rule80A { get; set; }
/**
* @brief Indicates whether or not all the order has to be filled on a single execution.
*/
public bool AllOrNone { get; set; }
/**
* @brief Identifies a minimum quantity order type.
*/
public int MinQty { get; set; }
/**
* @brief The percent offset amount for relative orders.
*/
public double PercentOffset { get; set; }
/**
* @brief Trail stop price for TRAIL LIMIT orders.
*/
public double TrailStopPrice { get; set; }
/**
* @brief Specifies the trailing amount of a trailing stop order as a percentage.\n
* Observe the following guidelines when using the trailingPercent field:
* - This field is mutually exclusive with the existing trailing amount. That is, the API client can send one or the other but not both.\n
* - This field is read AFTER the stop price (barrier price) as follows: deltaNeutralAuxPrice stopPrice, trailingPercent, scale order attributes\n
* - 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.
*/
public double TrailingPercent { get; set; }
/**
* @brief The Financial Advisor group the trade will be allocated to. Use an empty string if not applicable.
*/
public string FaGroup { get; set; }
/**
* @brief The Financial Advisor allocation profile the trade will be allocated to. Use an empty string if not applicable.
*/
public string FaProfile { get; set; }
/**
* @brief The Financial Advisor allocation method the trade will be allocated to. Use an empty string if not applicable.
*/
public string FaMethod { get; set; }
/**
* @brief The Financial Advisor percentage concerning the trade's allocation. Use an empty string if not applicable.
*/
public string FaPercentage { get; set; }
/**
* @brief For institutional customers only. Valid values are O (open) and C (close).\n
* Available for institutional clients to determine if this order is to open or close a position.\n
* When Action = "BUY" and OpenClose = "O" this will open a new position.\n
* When Action = "BUY" and OpenClose = "C" this will close and existing short position.
*/
public string OpenClose { get; set; }
/**
* @brief The order's origin. Same as TWS "Origin" column. Identifies the type of customer from which the order originated. \n
* Valid values are: \n
* 0 - Customer \n
* 1 - Firm
*/
public int Origin { get; set; }
/**
* @brief For institutions only. \n
* Valid values are: \n
* 1 - Broker holds shares \n
* 2 - Shares come from elsewhere
*/
public int ShortSaleSlot { get; set; }
/**
* 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).
*/
public string DesignatedLocation { get; set; }
/**
* @brief Only available with IB Execution-Only accounts with applicable securities. \n
* Mark order as exempt from short sale uptick rule
*/
public int ExemptCode { get; set; }
/**
* @brief The amount off the limit price allowed for discretionary orders.
*/
public double DiscretionaryAmt { get; set; }
/**
* @brief Use to opt out of default SmartRouting for orders routed directly to ASX. \n
* This attribute defaults to false unless explicitly set to true. \n
* When set to false, orders routed directly to ASX will NOT use SmartRouting. \n
* When set to true, orders routed directly to ASX orders WILL use SmartRouting
*/
public bool OptOutSmartRouting { get; set; }
/**
* @brief For BOX orders only. \n
* Values include: \n
* 1 - Match \n
* 2 - Improvement \n
* 3 - Transparent
*/
public int AuctionStrategy { get; set; }
/**
* @brief The auction's starting price. For BOX orders only.
*/
public double StartingPrice { get; set; }
/**
* @brief The stock's reference price.\n
* 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.
*/
public double StockRefPrice { get; set; }
/**
* @brief The stock's Delta. For orders on BOX only.
*/
public double Delta { get; set; }
/**
* @brief The lower value for the acceptable underlying stock price range.\n
* For price improvement option orders on BOX and VOL orders with dynamic management.
*/
public double StockRangeLower { get; set; }
/**
* @brief The upper value for the acceptable underlying stock price range.\n
* For price improvement option orders on BOX and VOL orders with dynamic management.
*/
public double StockRangeUpper { get; set; }
/**
* @brief The option price in volatility, as calculated by TWS' Option Analytics.\n
* This value is expressed as a percent and is used to calculate the limit price sent to the exchange.
*/
public double Volatility { get; set; }
/**
* @brief Values include: \n
* 1 - Daily Volatility \n
* 2 - Annual Volatility
*/
public int VolatilityType { get; set; }
/**
* @brief Specifies whether TWS will automatically update the limit price of the order as the underlying price moves. VOL orders only.
*/
public int ContinuousUpdate { get; set; }
/**
* @brief Specifies how you want TWS to calculate the limit price for options, and for stock range price monitoring.\n
* VOL orders only. \n
* Valid values include: \n
* 1 - Average of NBBO \n
* 2 - NBB or the NBO depending on the action and right.
*/
public int ReferencePriceType { get; set; }
/**
* @brief 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.
*/
public string DeltaNeutralOrderType { get; set; }
/**
* @brief 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.
*/
public double DeltaNeutralAuxPrice { get; set; }
/**
* @brief The unique contract identifier specifying the security in Delta Neutral order.
*/
public int DeltaNeutralConId { get; set; }
/**
* @brief Indicates the firm which will settle the Delta Neutral trade. Institutions only.
*/
public string DeltaNeutralSettlingFirm { get; set; }
/**
* @brief Specifies the beneficiary of the Delta Neutral order.
*/
public string DeltaNeutralClearingAccount { get; set; }
/**
* @brief Specifies where the clients want their shares to be cleared at. Must be specified by execution-only clients.\n
* Valid values are:\n
* IB, Away, and PTA (post trade allocation).
*/
public string DeltaNeutralClearingIntent { get; set; }
/**
* @brief 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.
*/
public string DeltaNeutralOpenClose { get; set; }
/**
* @brief Used when the hedge involves a stock and indicates whether or not it is sold short.
*/
public bool DeltaNeutralShortSale { get; set; }
/**
* @brief Indicates 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, then you must specify a deltaNeutralDesignatedLocation.
*/
public int DeltaNeutralShortSaleSlot { get; set; }
/**
* @brief Identifies third party order origin. Used only when deltaNeutralShortSaleSlot = 2.
*/
public string DeltaNeutralDesignatedLocation { get; set; }
/**
* @brief Specifies Basis Points for EFP order. The values increment in 0.01% = 1 basis point. For EFP orders only.
*/
public double BasisPoints { get; set; }
/**
* @brief Specifies the increment of the Basis Points. For EFP orders only.
*/
public int BasisPointsType { get; set; }
/**
* @brief Defines the size of the first, or initial, order component. For Scale orders only.
*/
public int ScaleInitLevelSize { get; set; }
/**
* @brief Defines the order size of the subsequent scale order components. For Scale orders only. Used in conjunction with scaleInitLevelSize().
*/
public int ScaleSubsLevelSize { get; set; }
/**
* @brief Defines the price increment between scale components. For Scale orders only. This value is compulsory.
*/
public double ScalePriceIncrement { get; set; }
/**
* @brief Modifies the value of the Scale order. For extended Scale orders.
*/
public double ScalePriceAdjustValue { get; set; }
/**
* @brief Specifies the interval when the price is adjusted. For extended Scale orders.
*/
public int ScalePriceAdjustInterval { get; set; }
/**
* @brief Specifies the offset when to adjust profit. For extended scale orders.
*/
public double ScaleProfitOffset { get; set; }
/**
* @brief Restarts the Scale series if the order is cancelled. For extended scale orders.
*/
public bool ScaleAutoReset { get; set; }
/**
* @brief The initial position of the Scale order. For extended scale orders.
*/
public int ScaleInitPosition { get; set; }
/**
* @brief Specifies the initial quantity to be filled. For extended scale orders.
*/
public int ScaleInitFillQty { get; set; }
/**
* @brief Defines the random percent by which to adjust the position. For extended scale orders.
*/
public bool ScaleRandomPercent { get; set; }
/**
* @brief For hedge orders.\n
* Possible values include:\n
* D - Delta \n
* B - Beta \n
* F - FX \n
* P - Pair
*/
public string HedgeType { get; set; }
/**
* @brief For hedge orders.\n
* Beta = x for Beta hedge orders, ratio = y for Pair hedge order
*/
public string HedgeParam { get; set; }
/**
* @brief The account the trade will be allocated to.
*/
public string Account { get; set; }
/**
* @brief Indicates the firm which will settle the trade. Institutions only.
*/
public string SettlingFirm { get; set; }
/**
* @brief Specifies the true beneficiary of the order.\n
* For IBExecution customers. This value is required for FUT/FOP orders for reporting to the exchange.
*/
public string ClearingAccount { get; set; }
/**
* @brief For execution-only clients to know where do they want their shares to be cleared at.\n
* Valid values are:\n
* IB, Away, and PTA (post trade allocation).
*/
public string ClearingIntent { get; set; }
/**
* @brief The algorithm strategy.\n
* As of API verion 9.6, the following algorithms are supported:\n
* ArrivalPx - Arrival Price \n
* DarkIce - Dark Ice \n
* PctVol - Percentage of Volume \n
* Twap - TWAP (Time Weighted Average Price) \n
* Vwap - VWAP (Volume Weighted Average Price) \n
* For more information about IB's API algorithms, refer to https://www.interactivebrokers.com/en/software/api/apiguide/tables/ibalgo_parameters.htm
*/
public string AlgoStrategy { get; set; }
/**
* @brief The list of parameters for the IB algorithm.\n
* For more information about IB's API algorithms, refer to https://www.interactivebrokers.com/en/software/api/apiguide/tables/ibalgo_parameters.htm
*/
public List AlgoParams { get; set; }
/**
* @brief Allows to retrieve the commissions and margin information.\n
* 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.
*/
public bool WhatIf { get; set; }
/**
* @brief Identifies orders generated by algorithmic trading.
*/
public string AlgoId { get; set; }
/**
* @brief 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.\n
* For IBDARK orders only.
*/
public bool NotHeld { get; set; }
/**
* @brief Advanced parameters for Smart combo routing. \n
* These features are for both guaranteed and nonguaranteed 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. \n
* 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 \n
* The parameters cover the following capabilities:
* - Non-Guaranteed - Determine if the combo order is Guaranteed or Non-Guaranteed. \n
* Tag = NonGuaranteed \n
* Value = 0: The order is guaranteed \n
* Value = 1: The order is non-guaranteed \n
* \n
* - Select Leg to Fill First - User can specify which leg to be executed first. \n
* Tag = LeginPrio \n
* Value = -1: No priority is assigned to either combo leg \n
* Value = 0: Priority is assigned to the first leg being added to the comboLeg \n
* Value = 1: Priority is assigned to the second leg being added to the comboLeg \n
* Note: The LeginPrio parameter can only be applied to two-legged combo. \n
* \n
* - Maximum Leg-In Combo Size - Specify the maximum allowed leg-in size per segment \n
* Tag = MaxSegSize \n
* Value = Unit of combo size \n
* \n
* - 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. \n
* Tag = DontLeginNext \n
* Value = 0: Start next leg-in even if previous leg-in did not finish \n
* Value = 1: Do not start next leg-in if previous leg-in did not finish \n
* \n
* - Price Condition - Combo order will be rejected or cancelled if the leg market price is outside of the specified price range [CondPriceMin, CondPriceMax] \n
* Tag = PriceCondConid: The ContractID of the combo leg to specify price condition on \n
* Value = The ContractID \n
* Tag = CondPriceMin: The lower price range of the price condition \n
* Value = The lower price \n
* Tag = CondPriceMax: The upper price range of the price condition \n
* Value = The upper price \n
* \n
*/
public List SmartComboRoutingParams { get; set; }
/**
* @brief 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.
*/
public List OrderComboLegs { get; set; } = new List();
/**
* @brief For internal use only. Use the default value XYZ.
*/
public List OrderMiscOptions { get; set; } = new List();
/**
* @brief Defines the start time of GTC orders.
*/
public string ActiveStartTime { get; set; }
/**
* @brief Defines the stop time of GTC orders.
*/
public string ActiveStopTime { get; set; }
/**
* @brief The list of scale orders. Used for scale orders.
*/
public string ScaleTable { get; set; }
/**
* @brief Is used to place an order to a model. For example, "Technology" model can be used for tech stocks first created in TWS.
*/
public string ModelCode { get; set; }
/**
* @brief This is a regulartory attribute that applies to all US Commodity (Futures) Exchanges, provided to allow client to comply with CFTC Tag 50 Rules
*/
public string ExtOperator { get; set; }
/**
* @brief The native cash quantity.
*/
public double CashQty { get; set; }
/**
* @brief 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+.
*/
public string Mifid2DecisionMaker { get; set; }
/**
* @brief 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+.
*/
public string Mifid2DecisionAlgo { get; set; }
/**
* @brief For MiFID 2 reporting; identifies a person as the responsible party for the execution of a transaction within the firm. Requires TWS 969+.
*/
public string Mifid2ExecutionTrader { get; set; }
/**
* @brief For MiFID 2 reporting; identifies the algorithm responsible for the execution of a transaction within the firm. Requires TWS 969+.
*/
public string Mifid2ExecutionAlgo { get; set; }
/**
* @brief Don't use auto price for hedge
*/
public bool DontUseAutoPriceForHedge { get; set; }
/**
* @brief Specifies the date to auto cancel the order.
*/
public string AutoCancelDate { get; set; }
/**
* @brief Specifies the initial order quantity to be filled.
*/
public decimal FilledQuantity { get; set; }
/**
* @brief Identifies the reference future conId.
*/
public int RefFuturesConId { get; set; }
/**
* @brief Cancels the parent order if child order was cancelled.
*/
public bool AutoCancelParent { get; set; }
/**
* @brief Identifies the Shareholder.
*/
public string Shareholder { get; set; }
/**
* @brief Used to specify "imbalance only open orders" or "imbalance only closing orders".
*/
public bool ImbalanceOnly { get; set; }
/**
* @brief Routes market order to Best Bid Offer.
*/
public bool RouteMarketableToBbo { get; set; }
/**
* @brief Parent order Id.
*/
public long ParentPermId { get; set; }
/**
* @brief Accepts a list with parameters obtained from advancedOrderRejectJson.
*/
public string AdvancedErrorOverride { get; set; }
/**
* @brief 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.
*/
public string ManualOrderTime { get; set; }
/**
* @brief Defines the minimum trade quantity to fill. For IBKRATS orders.
*/
public int MinTradeQty { get; set; }
/**
* @brief Defines the minimum size to compete. For IBKRATS orders.
*/
public int MinCompeteSize { get; set; }
/**
* @brief Dpecifies the offset Off The Midpoint that will be applied to the order. For IBKRATS orders.
*/
public double CompeteAgainstBestOffset { get; set; }
/**
* @brief 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.
*/
public double MidOffsetAtWhole { get; set; }
/**
* @brief 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.
*/
public double MidOffsetAtHalf { get; set; }
public Order()
{
LmtPrice = double.MaxValue;
AuxPrice = double.MaxValue;
ActiveStartTime = EMPTY_STR;
ActiveStopTime = EMPTY_STR;
OutsideRth = false;
OpenClose = EMPTY_STR;
Origin = CUSTOMER;
Transmit = true;
DesignatedLocation = EMPTY_STR;
ExemptCode = -1;
MinQty = int.MaxValue;
PercentOffset = double.MaxValue;
OptOutSmartRouting = false;
StartingPrice = double.MaxValue;
StockRefPrice = double.MaxValue;
Delta = double.MaxValue;
StockRangeLower = double.MaxValue;
StockRangeUpper = double.MaxValue;
Volatility = double.MaxValue;
VolatilityType = int.MaxValue;
DeltaNeutralOrderType = EMPTY_STR;
DeltaNeutralAuxPrice = double.MaxValue;
DeltaNeutralConId = 0;
DeltaNeutralSettlingFirm = EMPTY_STR;
DeltaNeutralClearingAccount = EMPTY_STR;
DeltaNeutralClearingIntent = EMPTY_STR;
DeltaNeutralOpenClose = EMPTY_STR;
DeltaNeutralShortSale = false;
DeltaNeutralShortSaleSlot = 0;
DeltaNeutralDesignatedLocation = EMPTY_STR;
ReferencePriceType = int.MaxValue;
TrailStopPrice = double.MaxValue;
TrailingPercent = double.MaxValue;
BasisPoints = double.MaxValue;
BasisPointsType = int.MaxValue;
ScaleInitLevelSize = int.MaxValue;
ScaleSubsLevelSize = int.MaxValue;
ScalePriceIncrement = double.MaxValue;
ScalePriceAdjustValue = double.MaxValue;
ScalePriceAdjustInterval = int.MaxValue;
ScaleProfitOffset = double.MaxValue;
ScaleAutoReset = false;
ScaleInitPosition = int.MaxValue;
ScaleInitFillQty = int.MaxValue;
ScaleRandomPercent = false;
ScaleTable = EMPTY_STR;
WhatIf = false;
NotHeld = false;
Conditions = new List();
TriggerPrice = double.MaxValue;
LmtPriceOffset = double.MaxValue;
AdjustedStopPrice = double.MaxValue;
AdjustedStopLimitPrice = double.MaxValue;
AdjustedTrailingAmount = double.MaxValue;
ExtOperator = EMPTY_STR;
Tier = new SoftDollarTier(EMPTY_STR, EMPTY_STR, EMPTY_STR);
CashQty = double.MaxValue;
Mifid2DecisionMaker = EMPTY_STR;
Mifid2DecisionAlgo = EMPTY_STR;
Mifid2ExecutionTrader = EMPTY_STR;
Mifid2ExecutionAlgo = EMPTY_STR;
DontUseAutoPriceForHedge = false;
AutoCancelDate = EMPTY_STR;
FilledQuantity = decimal.MaxValue;
RefFuturesConId = int.MaxValue;
AutoCancelParent = false;
Shareholder = EMPTY_STR;
ImbalanceOnly = false;
RouteMarketableToBbo = false;
ParentPermId = long.MaxValue;
UsePriceMgmtAlgo = null;
Duration = int.MaxValue;
PostToAts = int.MaxValue;
AdvancedErrorOverride = EMPTY_STR;
ManualOrderTime = EMPTY_STR;
MinTradeQty = int.MaxValue;
MinCompeteSize = int.MaxValue;
CompeteAgainstBestOffset = double.MaxValue;
MidOffsetAtWhole = double.MaxValue;
MidOffsetAtHalf = double.MaxValue;
}
// Note: Two orders can be 'equivalent' even if all fields do not match. This function is not intended to be used with Order objects returned from TWS.
public override bool Equals(object p_other)
{
if (this == p_other)
return true;
Order l_theOther = p_other as Order;
if (l_theOther == null)
return false;
if (PermId == l_theOther.PermId)
{
return true;
}
if (OrderId != l_theOther.OrderId ||
ClientId != l_theOther.ClientId ||
TotalQuantity != l_theOther.TotalQuantity ||
LmtPrice != l_theOther.LmtPrice ||
AuxPrice != l_theOther.AuxPrice ||
OcaType != l_theOther.OcaType ||
Transmit != l_theOther.Transmit ||
ParentId != l_theOther.ParentId ||
BlockOrder != l_theOther.BlockOrder ||
SweepToFill != l_theOther.SweepToFill ||
DisplaySize != l_theOther.DisplaySize ||
TriggerMethod != l_theOther.TriggerMethod ||
OutsideRth != l_theOther.OutsideRth ||
Hidden != l_theOther.Hidden ||
OverridePercentageConstraints != l_theOther.OverridePercentageConstraints ||
AllOrNone != l_theOther.AllOrNone ||
MinQty != l_theOther.MinQty ||
PercentOffset != l_theOther.PercentOffset ||
TrailStopPrice != l_theOther.TrailStopPrice ||
TrailingPercent != l_theOther.TrailingPercent ||
Origin != l_theOther.Origin ||
ShortSaleSlot != l_theOther.ShortSaleSlot ||
DiscretionaryAmt != l_theOther.DiscretionaryAmt ||
OptOutSmartRouting != l_theOther.OptOutSmartRouting ||
AuctionStrategy != l_theOther.AuctionStrategy ||
StartingPrice != l_theOther.StartingPrice ||
StockRefPrice != l_theOther.StockRefPrice ||
Delta != l_theOther.Delta ||
StockRangeLower != l_theOther.StockRangeLower ||
StockRangeUpper != l_theOther.StockRangeUpper ||
Volatility != l_theOther.Volatility ||
VolatilityType != l_theOther.VolatilityType ||
ContinuousUpdate != l_theOther.ContinuousUpdate ||
ReferencePriceType != l_theOther.ReferencePriceType ||
DeltaNeutralAuxPrice != l_theOther.DeltaNeutralAuxPrice ||
DeltaNeutralConId != l_theOther.DeltaNeutralConId ||
DeltaNeutralShortSale != l_theOther.DeltaNeutralShortSale ||
DeltaNeutralShortSaleSlot != l_theOther.DeltaNeutralShortSaleSlot ||
BasisPoints != l_theOther.BasisPoints ||
BasisPointsType != l_theOther.BasisPointsType ||
ScaleInitLevelSize != l_theOther.ScaleInitLevelSize ||
ScaleSubsLevelSize != l_theOther.ScaleSubsLevelSize ||
ScalePriceIncrement != l_theOther.ScalePriceIncrement ||
ScalePriceAdjustValue != l_theOther.ScalePriceAdjustValue ||
ScalePriceAdjustInterval != l_theOther.ScalePriceAdjustInterval ||
ScaleProfitOffset != l_theOther.ScaleProfitOffset ||
ScaleAutoReset != l_theOther.ScaleAutoReset ||
ScaleInitPosition != l_theOther.ScaleInitPosition ||
ScaleInitFillQty != l_theOther.ScaleInitFillQty ||
ScaleRandomPercent != l_theOther.ScaleRandomPercent ||
WhatIf != l_theOther.WhatIf ||
NotHeld != l_theOther.NotHeld ||
ExemptCode != l_theOther.ExemptCode ||
RandomizePrice != l_theOther.RandomizePrice ||
RandomizeSize != l_theOther.RandomizeSize ||
Solicited != l_theOther.Solicited ||
ConditionsIgnoreRth != l_theOther.ConditionsIgnoreRth ||
ConditionsCancelOrder != l_theOther.ConditionsCancelOrder ||
Tier != l_theOther.Tier ||
CashQty != l_theOther.CashQty ||
DontUseAutoPriceForHedge != l_theOther.DontUseAutoPriceForHedge ||
IsOmsContainer != l_theOther.IsOmsContainer ||
UsePriceMgmtAlgo != l_theOther.UsePriceMgmtAlgo ||
FilledQuantity != l_theOther.FilledQuantity ||
RefFuturesConId != l_theOther.RefFuturesConId ||
AutoCancelParent != l_theOther.AutoCancelParent ||
ImbalanceOnly != l_theOther.ImbalanceOnly ||
RouteMarketableToBbo != l_theOther.RouteMarketableToBbo ||
ParentPermId != l_theOther.ParentPermId ||
Duration != l_theOther.Duration ||
PostToAts != l_theOther.PostToAts ||
MinTradeQty != l_theOther.MinTradeQty ||
MinCompeteSize != l_theOther.MinCompeteSize ||
CompeteAgainstBestOffset != l_theOther.CompeteAgainstBestOffset ||
MidOffsetAtWhole != l_theOther.MidOffsetAtWhole ||
MidOffsetAtHalf != l_theOther.MidOffsetAtHalf)
{
return false;
}
if (Util.StringCompare(Action, l_theOther.Action) != 0 ||
Util.StringCompare(OrderType, l_theOther.OrderType) != 0 ||
Util.StringCompare(Tif, l_theOther.Tif) != 0 ||
Util.StringCompare(ActiveStartTime, l_theOther.ActiveStartTime) != 0 ||
Util.StringCompare(ActiveStopTime, l_theOther.ActiveStopTime) != 0 ||
Util.StringCompare(OcaGroup, l_theOther.OcaGroup) != 0 ||
Util.StringCompare(OrderRef, l_theOther.OrderRef) != 0 ||
Util.StringCompare(GoodAfterTime, l_theOther.GoodAfterTime) != 0 ||
Util.StringCompare(GoodTillDate, l_theOther.GoodTillDate) != 0 ||
Util.StringCompare(Rule80A, l_theOther.Rule80A) != 0 ||
Util.StringCompare(FaGroup, l_theOther.FaGroup) != 0 ||
Util.StringCompare(FaProfile, l_theOther.FaProfile) != 0 ||
Util.StringCompare(FaMethod, l_theOther.FaMethod) != 0 ||
Util.StringCompare(FaPercentage, l_theOther.FaPercentage) != 0 ||
Util.StringCompare(OpenClose, l_theOther.OpenClose) != 0 ||
Util.StringCompare(DesignatedLocation, l_theOther.DesignatedLocation) != 0 ||
Util.StringCompare(DeltaNeutralOrderType, l_theOther.DeltaNeutralOrderType) != 0 ||
Util.StringCompare(DeltaNeutralSettlingFirm, l_theOther.DeltaNeutralSettlingFirm) != 0 ||
Util.StringCompare(DeltaNeutralClearingAccount, l_theOther.DeltaNeutralClearingAccount) != 0 ||
Util.StringCompare(DeltaNeutralClearingIntent, l_theOther.DeltaNeutralClearingIntent) != 0 ||
Util.StringCompare(DeltaNeutralOpenClose, l_theOther.DeltaNeutralOpenClose) != 0 ||
Util.StringCompare(DeltaNeutralDesignatedLocation, l_theOther.DeltaNeutralDesignatedLocation) != 0 ||
Util.StringCompare(HedgeType, l_theOther.HedgeType) != 0 ||
Util.StringCompare(HedgeParam, l_theOther.HedgeParam) != 0 ||
Util.StringCompare(Account, l_theOther.Account) != 0 ||
Util.StringCompare(SettlingFirm, l_theOther.SettlingFirm) != 0 ||
Util.StringCompare(ClearingAccount, l_theOther.ClearingAccount) != 0 ||
Util.StringCompare(ClearingIntent, l_theOther.ClearingIntent) != 0 ||
Util.StringCompare(AlgoStrategy, l_theOther.AlgoStrategy) != 0 ||
Util.StringCompare(AlgoId, l_theOther.AlgoId) != 0 ||
Util.StringCompare(ScaleTable, l_theOther.ScaleTable) != 0 ||
Util.StringCompare(ModelCode, l_theOther.ModelCode) != 0 ||
Util.StringCompare(ExtOperator, l_theOther.ExtOperator) != 0 ||
Util.StringCompare(AutoCancelDate, l_theOther.AutoCancelDate) != 0 ||
Util.StringCompare(Shareholder, l_theOther.Shareholder) != 0 ||
Util.StringCompare(AdvancedErrorOverride, l_theOther.AdvancedErrorOverride) != 0 ||
Util.StringCompare(ManualOrderTime, l_theOther.ManualOrderTime) != 0)
{
return false;
}
if (!Util.VectorEqualsUnordered(AlgoParams, l_theOther.AlgoParams))
{
return false;
}
if (!Util.VectorEqualsUnordered(SmartComboRoutingParams, l_theOther.SmartComboRoutingParams))
{
return false;
}
// compare order combo legs
if (!Util.VectorEqualsUnordered(OrderComboLegs, l_theOther.OrderComboLegs))
{
return false;
}
return true;
}
public override int GetHashCode()
{
var hashCode = 1040337091;
hashCode = hashCode * -1521134295 + OrderId.GetHashCode();
hashCode = hashCode * -1521134295 + Solicited.GetHashCode();
hashCode = hashCode * -1521134295 + ClientId.GetHashCode();
hashCode = hashCode * -1521134295 + PermId.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Action);
hashCode = hashCode * -1521134295 + TotalQuantity.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(OrderType);
hashCode = hashCode * -1521134295 + LmtPrice.GetHashCode();
hashCode = hashCode * -1521134295 + AuxPrice.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Tif);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(OcaGroup);
hashCode = hashCode * -1521134295 + OcaType.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(OrderRef);
hashCode = hashCode * -1521134295 + Transmit.GetHashCode();
hashCode = hashCode * -1521134295 + ParentId.GetHashCode();
hashCode = hashCode * -1521134295 + BlockOrder.GetHashCode();
hashCode = hashCode * -1521134295 + SweepToFill.GetHashCode();
hashCode = hashCode * -1521134295 + DisplaySize.GetHashCode();
hashCode = hashCode * -1521134295 + TriggerMethod.GetHashCode();
hashCode = hashCode * -1521134295 + OutsideRth.GetHashCode();
hashCode = hashCode * -1521134295 + Hidden.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(GoodAfterTime);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(GoodTillDate);
hashCode = hashCode * -1521134295 + OverridePercentageConstraints.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Rule80A);
hashCode = hashCode * -1521134295 + AllOrNone.GetHashCode();
hashCode = hashCode * -1521134295 + MinQty.GetHashCode();
hashCode = hashCode * -1521134295 + PercentOffset.GetHashCode();
hashCode = hashCode * -1521134295 + TrailStopPrice.GetHashCode();
hashCode = hashCode * -1521134295 + TrailingPercent.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(FaGroup);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(FaProfile);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(FaMethod);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(FaPercentage);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(OpenClose);
hashCode = hashCode * -1521134295 + Origin.GetHashCode();
hashCode = hashCode * -1521134295 + ShortSaleSlot.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(DesignatedLocation);
hashCode = hashCode * -1521134295 + ExemptCode.GetHashCode();
hashCode = hashCode * -1521134295 + DiscretionaryAmt.GetHashCode();
hashCode = hashCode * -1521134295 + OptOutSmartRouting.GetHashCode();
hashCode = hashCode * -1521134295 + AuctionStrategy.GetHashCode();
hashCode = hashCode * -1521134295 + StartingPrice.GetHashCode();
hashCode = hashCode * -1521134295 + StockRefPrice.GetHashCode();
hashCode = hashCode * -1521134295 + Delta.GetHashCode();
hashCode = hashCode * -1521134295 + StockRangeLower.GetHashCode();
hashCode = hashCode * -1521134295 + StockRangeUpper.GetHashCode();
hashCode = hashCode * -1521134295 + Volatility.GetHashCode();
hashCode = hashCode * -1521134295 + VolatilityType.GetHashCode();
hashCode = hashCode * -1521134295 + ContinuousUpdate.GetHashCode();
hashCode = hashCode * -1521134295 + ReferencePriceType.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(DeltaNeutralOrderType);
hashCode = hashCode * -1521134295 + DeltaNeutralAuxPrice.GetHashCode();
hashCode = hashCode * -1521134295 + DeltaNeutralConId.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(DeltaNeutralSettlingFirm);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(DeltaNeutralClearingAccount);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(DeltaNeutralClearingIntent);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(DeltaNeutralOpenClose);
hashCode = hashCode * -1521134295 + DeltaNeutralShortSale.GetHashCode();
hashCode = hashCode * -1521134295 + DeltaNeutralShortSaleSlot.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(DeltaNeutralDesignatedLocation);
hashCode = hashCode * -1521134295 + BasisPoints.GetHashCode();
hashCode = hashCode * -1521134295 + BasisPointsType.GetHashCode();
hashCode = hashCode * -1521134295 + ScaleInitLevelSize.GetHashCode();
hashCode = hashCode * -1521134295 + ScaleSubsLevelSize.GetHashCode();
hashCode = hashCode * -1521134295 + ScalePriceIncrement.GetHashCode();
hashCode = hashCode * -1521134295 + ScalePriceAdjustValue.GetHashCode();
hashCode = hashCode * -1521134295 + ScalePriceAdjustInterval.GetHashCode();
hashCode = hashCode * -1521134295 + ScaleProfitOffset.GetHashCode();
hashCode = hashCode * -1521134295 + ScaleAutoReset.GetHashCode();
hashCode = hashCode * -1521134295 + ScaleInitPosition.GetHashCode();
hashCode = hashCode * -1521134295 + ScaleInitFillQty.GetHashCode();
hashCode = hashCode * -1521134295 + ScaleRandomPercent.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(HedgeType);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(HedgeParam);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Account);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(SettlingFirm);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(ClearingAccount);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(ClearingIntent);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(AlgoStrategy);
hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(AlgoParams);
hashCode = hashCode * -1521134295 + WhatIf.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(AlgoId);
hashCode = hashCode * -1521134295 + NotHeld.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(SmartComboRoutingParams);
hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(OrderComboLegs);
hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(OrderMiscOptions);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(ActiveStartTime);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(ActiveStopTime);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(ScaleTable);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(ModelCode);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(ExtOperator);
hashCode = hashCode * -1521134295 + CashQty.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Mifid2DecisionMaker);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Mifid2DecisionAlgo);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Mifid2ExecutionTrader);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Mifid2ExecutionAlgo);
hashCode = hashCode * -1521134295 + DontUseAutoPriceForHedge.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(AutoCancelDate);
hashCode = hashCode * -1521134295 + FilledQuantity.GetHashCode();
hashCode = hashCode * -1521134295 + RefFuturesConId.GetHashCode();
hashCode = hashCode * -1521134295 + AutoCancelParent.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Shareholder);
hashCode = hashCode * -1521134295 + ImbalanceOnly.GetHashCode();
hashCode = hashCode * -1521134295 + RouteMarketableToBbo.GetHashCode();
hashCode = hashCode * -1521134295 + ParentPermId.GetHashCode();
hashCode = hashCode * -1521134295 + RandomizeSize.GetHashCode();
hashCode = hashCode * -1521134295 + RandomizePrice.GetHashCode();
hashCode = hashCode * -1521134295 + ReferenceContractId.GetHashCode();
hashCode = hashCode * -1521134295 + IsPeggedChangeAmountDecrease.GetHashCode();
hashCode = hashCode * -1521134295 + PeggedChangeAmount.GetHashCode();
hashCode = hashCode * -1521134295 + ReferenceChangeAmount.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(ReferenceExchange);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(AdjustedOrderType);
hashCode = hashCode * -1521134295 + TriggerPrice.GetHashCode();
hashCode = hashCode * -1521134295 + LmtPriceOffset.GetHashCode();
hashCode = hashCode * -1521134295 + AdjustedStopPrice.GetHashCode();
hashCode = hashCode * -1521134295 + AdjustedStopLimitPrice.GetHashCode();
hashCode = hashCode * -1521134295 + AdjustedTrailingAmount.GetHashCode();
hashCode = hashCode * -1521134295 + AdjustableTrailingUnit.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(Conditions);
hashCode = hashCode * -1521134295 + ConditionsIgnoreRth.GetHashCode();
hashCode = hashCode * -1521134295 + ConditionsCancelOrder.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(Tier);
hashCode = hashCode * -1521134295 + IsOmsContainer.GetHashCode();
hashCode = hashCode * -1521134295 + DiscretionaryUpToLimitPrice.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(UsePriceMgmtAlgo);
hashCode = hashCode * -1521134295 + Duration.GetHashCode();
hashCode = hashCode * -1521134295 + PostToAts.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(AdvancedErrorOverride);
hashCode = hashCode * -1521134295 + EqualityComparer.Default.GetHashCode(ManualOrderTime);
hashCode = hashCode * -1521134295 + MinTradeQty.GetHashCode();
hashCode = hashCode * -1521134295 + MinCompeteSize.GetHashCode();
hashCode = hashCode * -1521134295 + CompeteAgainstBestOffset.GetHashCode();
hashCode = hashCode * -1521134295 + MidOffsetAtWhole.GetHashCode();
hashCode = hashCode * -1521134295 + MidOffsetAtHalf.GetHashCode();
return hashCode;
}
/**
* @brief Randomizes the order's size. Only for Volatility and Pegged to Volatility orders.
*/
public bool RandomizeSize { get; set; }
/**
* @brief Randomizes the order's price. Only for Volatility and Pegged to Volatility orders.
*/
public bool RandomizePrice { get; set; }
/**
* @brief Pegged-to-benchmark orders: this attribute will contain the conId of the contract against which the order will be pegged.
*/
public int ReferenceContractId { get; set; }
/**
* @brief Pegged-to-benchmark orders: indicates whether the order's pegged price should increase or decreases.
*/
public bool IsPeggedChangeAmountDecrease { get; set; }
/**
* @brief Pegged-to-benchmark orders: amount by which the order's pegged price should move.
*/
public double PeggedChangeAmount { get; set; }
/**
* @brief Pegged-to-benchmark orders: the amount the reference contract needs to move to adjust the pegged order.
*/
public double ReferenceChangeAmount { get; set; }
/**
* @brief Pegged-to-benchmark orders: the exchange against which we want to observe the reference contract.
*/
public string ReferenceExchange { get; set; }
/**
* @brief Adjusted Stop orders: the parent order will be adjusted to the given type when the adjusted trigger price is penetrated.
*/
public string AdjustedOrderType { get; set; }
/**
* @brief Adjusted Stop orders: specifies the trigger price to execute.
*/
public double TriggerPrice { get; set; }
/**
* @brief Adjusted Stop orders: specifies the price offset for the stop to move in increments.
*/
public double LmtPriceOffset { get; set; }
/**
* @brief Adjusted Stop orders: specifies the stop price of the adjusted (STP) parent
*/
public double AdjustedStopPrice { get; set; }
/**
* @brief Adjusted Stop orders: specifies the stop limit price of the adjusted (STPL LMT) parent
*/
public double AdjustedStopLimitPrice { get; set; }
/**
* @brief Adjusted Stop orders: specifies the trailing amount of the adjusted (TRAIL) parent
*/
public double AdjustedTrailingAmount { get; set; }
/**
* @brief Adjusted Stop orders: specifies where the trailing unit is an amount (set to 0) or a percentage (set to 1)
*/
public int AdjustableTrailingUnit { get; set; }
/**
* @brief Conditions determining when the order will be activated or canceled
*/
public List Conditions { get; set; }
/**
* @brief Indicates whether or not conditions will also be valid outside Regular Trading Hours
*/
public bool ConditionsIgnoreRth { get; set; }
/**
* @brief Conditions can determine if an order should become active or canceled.
*/
public bool ConditionsCancelOrder { get; set; }
/**
* @brief Define the Soft Dollar Tier used for the order. Only provided for registered professional advisors and hedge and mutual funds.
*/
public SoftDollarTier Tier { get; set; }
/**
* @brief Set to true to create tickets from API orders when TWS is used as an OMS
*/
public bool IsOmsContainer { get; set; }
/**
* @brief Set to true to convert order of type 'Primary Peg' to 'D-Peg'
*/
public bool DiscretionaryUpToLimitPrice { get; set; }
/**
* @brief Specifies wether to use Price Management Algo. CTCI users only.
*/
public bool? UsePriceMgmtAlgo { get; set; }
/**
* @brief Specifies the duration of the order. Format: yyyymmdd hh:mm:ss TZ. For GTD orders.
*/
public int Duration { get; set; }
/**
* @brief Value must be positive, and it is number of seconds that SMART order would be parked for at IBKRATS before being routed to exchange.
*/
public int PostToAts { get; set; }
}
}