Esempio n. 1
0
        //private CommodityBase commodityBase;

        public Commodity(CommodityPool parent, CommodityBase commodityBase)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }
            if (commodityBase == null)
            {
                throw new ArgumentNullException("commodityBase");
            }

            Parent = parent;
            Base   = commodityBase;
            // IsAnnotated = false;
        }
Esempio n. 2
0
        public Commodity Create(string symbol)
        {
            CommodityBase commodityBase = new CommodityBase(symbol);
            Commodity     commodity     = new Commodity(this, commodityBase);

            Logger.Debug("pool.commodities", () => String.Format("Creating base commodity {0}", symbol));

            // Create the "qualified symbol" version of this commodity's symbol
            if (Commodity.SymbolNeedsQuotes(symbol))
            {
                commodity.QualifiedSymbol = String.Format("\"{0}\"", symbol);
            }

            Logger.Debug("pool.commodities", () => String.Format("Creating commodity '{0}'", symbol));

            Commodities.Add(symbol, commodity);
            CommodityPriceHistory.AddCommodity(commodity);

            return(commodity);
        }