using System; namespace Krs.Ats.IBNet { /// /// Used to manage the legs of a combination order. /// /// /// [Serializable()] public class ComboLeg { #region Private Variables private ActionSide action; // BUY/SELL/SSHORT private int conId; private String exchange; private ComboOpenClose openClose; private int ratio; private int exemptCode; // for stock legs when doing short sale private ShortSaleSlot shortSaleSlot; // 1 = clearing broker, 2 = third party private String designatedLocation; #endregion #region Constructors /// /// Initialize the ComboLeg /// public ComboLeg() : this(0,0,ActionSide.Undefined, null, ComboOpenClose.Unknown, ShortSaleSlot.Unapplicable, null, -1) { } /// /// Initialize the ComboLeg /// /// The unique contract identifier specifying the security. See property . /// Select the relative number of contracts for the leg you are constructing. See property . /// The side (buy or sell) for the leg you are constructing. See property /// The exchange to which the complete combination order will be routed. See property . /// Specifies whether the order is an open or close order. Retail customers must use . See property /// ShortSaleSlot of Third Party requires DesignatedLocation to be specified. Non-empty DesignatedLocation values for all other cases will cause orders to be rejected. See Property /// Use only when shortSaleSlot value = 2. See Property public ComboLeg(int conId, int ratio, ActionSide action, String exchange, ComboOpenClose openClose, ShortSaleSlot shortSaleSlot, string designatedLocation) : this(conId, ratio, action, exchange, openClose, shortSaleSlot, designatedLocation, -1) { } /// /// Initialize the ComboLeg /// /// The unique contract identifier specifying the security. See property . /// Select the relative number of contracts for the leg you are constructing. See property . /// The side (buy or sell) for the leg you are constructing. See property /// The exchange to which the complete combination order will be routed. See property . /// Specifies whether the order is an open or close order. Retail customers must use . See property /// ShortSaleSlot of Third Party requires DesignatedLocation to be specified. Non-empty DesignatedLocation values for all other cases will cause orders to be rejected. See Property /// Use only when shortSaleSlot value = 2. See Property /// Short Sale Exempt Code. See Property public ComboLeg(int conId, int ratio, ActionSide action, String exchange, ComboOpenClose openClose, ShortSaleSlot shortSaleSlot, string designatedLocation, int exemptCode) { this.conId = conId; this.ratio = ratio; this.action = action; this.exchange = exchange; this.openClose = openClose; this.shortSaleSlot = shortSaleSlot; this.designatedLocation = designatedLocation; this.exemptCode = exemptCode; } #endregion #region Properties /// /// The unique contract identifier specifying the security. /// public int ConId { get { return conId; } set { conId = value; } } /// /// Select the relative number of contracts for the leg you are constructing. /// To help determine the ratio for a specific combination order, refer to the /// Interactive Analytics section of the User's Guide. /// public int Ratio { get { return ratio; } set { ratio = value; } } /// /// The side (buy or sell) for the leg you are constructing. /// public ActionSide Action { get { return action; } set { action = value; } } /// /// The exchange to which the complete combination order will be routed. /// public string Exchange { get { return exchange; } set { exchange = value; } } /// /// Specifies whether the order is an open or close order. /// Retail customers must use . /// /// public ComboOpenClose OpenClose { get { return openClose; } set { openClose = value; } } /// /// ShortSaleSlot of Third Party requires DesignatedLocation to be specified. Non-empty DesignatedLocation values for all other cases will cause orders to be rejected. /// public ShortSaleSlot ShortSaleSlot { get { return shortSaleSlot; } set { shortSaleSlot = value; } } /// /// Use only when shortSaleSlot value = 2. /// public string DesignatedLocation { get { return designatedLocation; } set { designatedLocation = value; } } /// /// Short Sale Exempt Code /// public int ExemptCode { get { return exemptCode; } set { exemptCode = value; } } #endregion } }