Ejemplo n.º 1
0
        void IStringifiable.SetAttributes(Dictionary <string, string> attributes)
        {
            TradePageType pageType;

            foreach (KeyValuePair <string, string> a in attributes)
            {
                if (a.Key == "PageType" && Enum.TryParse <TradePageType>(a.Value, out pageType))
                {
                    this.PageType = pageType;
                }
            }
        }
Ejemplo n.º 2
0
        // TODO: Create an overloading that takes QuoteLegs,
        // if that is more convenient for execution engines.
        //
        //
        //
        #endregion//Constructors


        #region no Properties
        // *****************************************************************
        // ****                     Properties                          ****
        // *****************************************************************
        //
        //
        #endregion//Properties


        #region Public Methods
        // *****************************************************************
        // ****                     Public Methods                      ****
        // *****************************************************************
        //
        //
        //
        // *********************************************
        // ****             AddFill()               ****
        // *********************************************
        /// <summary>
        /// Add a new fill to this Trade object.
        /// </summary>
        /// <param name="instrumentName"></param>
        /// <param name="type"></param>
        /// <param name="newFill"></param>
        public void AddFill(InstrumentName instrumentName, TradePageType type, Fill newFill)
        {
            // Locate appropriate TradePage, or if need be, create new page.
            Dictionary <InstrumentName, TradePage> tradePageDict = null;

            if (type == TradePageType.Entry)
            {
                tradePageDict = this.Entry;
            }
            else if (type == TradePageType.Exit)
            {
                tradePageDict = this.Exit;
            }
            TradePage page = null;

            if (tradePageDict.TryGetValue(instrumentName, out page) == false)
            {
                page = new TradePage(instrumentName, type);
            }

            // Add fill to page.
            page.Fills.Add(newFill);
        }// AddFill()
Ejemplo n.º 3
0
 public TradePage(InstrumentName instrumentName, TradePageType type)
 {
     this.InstrumentName = instrumentName;
     this.PageType       = type;
     Fills = new List <Fill>();
 }