using System; namespace Krs.Ats.IBNet { /// /// Contract details returned from Interactive Brokers /// [Serializable()] public class ContractDetails { #region Private Variables private String marketName; private double minTick; private String orderTypes; private int priceMagnifier; private Contract summary; private String tradingClass; private String validExchanges; private int underConId; private String longName; private String contractMonth; private String industry; private String category; private String subcategory; private String timeZoneId; private String tradingHours; private String liquidHours; // BOND values private String cusip; private String ratings; private String descriptionAppend; private String bondType; private String couponType; private bool callable; private bool putable; private double coupon; private bool convertible; private String maturity; private String issueDate; private String nextOptionDate; private String nextOptionType; private bool nextOptionPartial; private String notes; #endregion #region Constructors /// /// Default constructor /// public ContractDetails() : this(new Contract(), null, null, 0, null, null, 0, null, null, null, null, null, null, null, null) { } /// /// Full Constructor /// /// A contract summary. /// The market name for this contract. /// The trading class name for this contract. /// The minimum price tick. /// The list of valid order types for this contract. /// The list of exchanges this contract is traded on. /// The Underlying Contract Id (for derivatives only) /// Long Name /// The contract month. Typically the contract month of the underlying for a futures contract. /// The industry classification of the underlying/product. For example, Financial. /// The industry category of the underlying. For example, InvestmentSvc. /// The industry subcategory of the underlying. For example, Brokerage. /// The ID of the time zone for the trading hours of the product. For example, EST. /// The trading hours of the product. For example, 20090507:0700-1830,1830-2330;20090508:CLOSED. /// The liquid trading hours of the product. For example, 20090507:0930-1600;20090508:CLOSED. public ContractDetails(Contract summary, String marketName, String tradingClass, double minTick, String orderTypes, String validExchanges, int underConId, String longName, String contractMonth, String industry, String category, String subcategory, String timeZoneId, String tradingHours, String liquidHours) { this.summary = summary; this.marketName = marketName; this.tradingClass = tradingClass; this.minTick = minTick; this.orderTypes = orderTypes; this.validExchanges = validExchanges; this.underConId = underConId; this.longName = longName; this.contractMonth = contractMonth; this.industry = industry; this.category = category; this.subcategory = subcategory; this.timeZoneId = timeZoneId; this.tradingHours = tradingHours; this.liquidHours = liquidHours; } #endregion #region Properties /// /// A contract summary. /// public Contract Summary { get { return summary; } set { summary = value; } } /// /// The market name for this contract. /// public string MarketName { get { return marketName; } set { marketName = value; } } /// /// The trading class name for this contract. /// public string TradingClass { get { return tradingClass; } set { tradingClass = value; } } /// /// The minimum price tick. /// public double MinTick { get { return minTick; } set { minTick = value; } } /// /// Allows execution and strike prices to be reported consistently with /// market data, historical data and the order price, i.e. Z on LIFFE is /// reported in index points and not GBP. /// public int PriceMagnifier { get { return priceMagnifier; } set { priceMagnifier = value; } } /// /// The list of valid order types for this contract. /// public string OrderTypes { get { return orderTypes; } set { orderTypes = value; } } /// /// The list of exchanges this contract is traded on. /// public string ValidExchanges { get { return validExchanges; } set { validExchanges = value; } } /// /// Underlying Contract Id /// underConId (underlying contract ID), has been added to the /// ContractDetails structure to allow unambiguous identification with the underlying contract /// (you no longer have to match by symbol, etc.). This new field applies to derivatives only. /// public int UnderConId { get { return underConId; } set { underConId = value; } } /// /// For Bonds. The nine-character bond CUSIP or the 12-character SEDOL. /// public string Cusip { get { return cusip; } set { cusip = value; } } /// /// For Bonds. Identifies the credit rating of the issuer. A higher credit /// rating generally indicates a less risky investment. Bond ratings /// are from Moody's and SP respectively. /// public string Ratings { get { return ratings; } set { ratings = value; } } /// /// For Bonds. A description string containing further descriptive information about the bond. /// public string DescriptionAppend { get { return descriptionAppend; } set { descriptionAppend = value; } } /// /// For Bonds. The type of bond, such as "CORP." /// public string BondType { get { return bondType; } set { bondType = value; } } /// /// For Bonds. The type of bond coupon, such as "FIXED." /// public string CouponType { get { return couponType; } set { couponType = value; } } /// /// For Bonds. Values are True or False. If true, the bond can be called /// by the issuer under certain conditions. /// public bool Callable { get { return callable; } set { callable = value; } } /// /// For Bonds. Values are True or False. If true, the bond can be sold /// back to the issuer under certain conditions. /// public bool Putable { get { return putable; } set { putable = value; } } /// /// For Bonds. The interest rate used to calculate the amount you will /// receive in interest payments over the course of the year. /// public double Coupon { get { return coupon; } set { coupon = value; } } /// /// For Bonds. Values are True or False. /// If true, the bond can be converted to stock under certain conditions. /// public bool Convertible { get { return convertible; } set { convertible = value; } } /// /// For Bonds. The date on which the issuer must repay the face value of the bond. /// public string Maturity { get { return maturity; } set { maturity = value; } } /// /// For Bonds. The date the bond was issued. /// public string IssueDate { get { return issueDate; } set { issueDate = value; } } /// /// For Bonds, relevant if the bond has embedded options /// public string NextOptionDate { get { return nextOptionDate; } set { nextOptionDate = value; } } /// /// For Bonds, relevant if the bond has embedded options /// public string NextOptionType { get { return nextOptionType; } set { nextOptionType = value; } } /// /// For Bonds, relevant if the bond has embedded options, i.e., is the next option full or partial? /// public bool NextOptionPartial { get { return nextOptionPartial; } set { nextOptionPartial = value; } } /// /// For Bonds, if populated for the bond in IBs database /// public string Notes { get { return notes; } set { notes = value; } } /// /// Long Name /// public String LongName { get { return longName; } set { longName = value; } } /// /// The contract month. Typically the contract month of the underlying for a futures contract. /// public String ContractMonth { get { return contractMonth; } set { contractMonth = value; } } /// /// The industry classification of the underlying/product. For example, Financial. /// public String Industry { get { return industry; } set { industry = value; } } /// /// The industry category of the underlying. For example, InvestmentSvc. /// public String Category { get { return category; } set { category = value; } } /// /// The industry subcategory of the underlying. For example, Brokerage. /// public String Subcategory { get { return subcategory; } set { subcategory = value; } } /// /// The ID of the time zone for the trading hours of the product. For example, EST. /// public String TimeZoneId { get { return timeZoneId; } set { timeZoneId = value; } } /// /// The trading hours of the product. For example, 20090507:0700-1830,1830-2330;20090508:CLOSED. /// public String TradingHours { get { return tradingHours; } set { tradingHours = value; } } /// /// The liquid trading hours of the product. For example, 20090507:0930-1600;20090508:CLOSED. /// public String LiquidHours { get { return liquidHours; } set { liquidHours = value; } } #endregion } }