Beispiel #1
0
        /// <summary>
        /// Prices the specified trade.
        /// </summary>
        /// <param name="trade">The trade.</param>
        /// <param name="market">The market.</param>
        /// <param name="result">The result.</param>
        /// <exception cref="System.Exception"></exception>
        public void Price(ITrade trade, IMarketData market, IResult result)
        {
            Func <ITradePricer> pricer;

            if (!_factory.TryGetValue(trade.GetType(), out pricer))
            {
                throw new Exception(String.Format("Unknown trade type {0}", trade.GetType()));
            }

            pricer().Price(trade, market, result);
        }