コード例 #1
0
        internal void AddOption(OptionSeries series, bool isCall, double strike, InstrumentProfile option)
        {
            OptionSeries os;

            if (!seriesMap.TryGetValue(series, out os))
            {
                os = new OptionSeries(series);
                seriesMap.Add(os, os);
            }
            os.AddOption(isCall, strike, option);
        }
コード例 #2
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);
        }