Esempio n. 1
0
        /// <summary>
        /// Returns a shall copy of this option chain.
        /// All series are copied(cloned) themselves, but option instrument instances are shared with original.
        /// </summary>
        /// <returns>Returns a shall copy of this option chain.</returns>
        public object Clone()
        {
            OptionChain clone = new OptionChain(Symbol);

            foreach (var series in seriesMap.Values)
            {
                OptionSeries seriesClone = (OptionSeries)series.Clone();
                clone.seriesMap.Add(seriesClone, seriesClone);
            }
            return(clone);
        }
        private OptionChain GetOrCreateChain(string symbol)
        {
            OptionChain chain;

            if (!Chains.TryGetValue(symbol, out chain))
            {
                chain          = new OptionChain(symbol);
                Chains[symbol] = chain;
            }
            return(chain);
        }