Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="underlying"></param>
        /// <param name="spot"></param>
        /// <param name="callStrike"></param>
        /// <param name="style"></param>
        /// <param name="tradeDate"></param>
        /// <param name="expiryDate"></param>
        /// <param name="zeroRange"></param>
        /// <param name="divRange"></param>
        /// <param name="orcParamsRange"></param>
        /// <returns></returns>
        public double CallCollarPricer(string underlying, double spot, double callStrike,
                                       string style, DateTime tradeDate, DateTime expiryDate,
                                       Excel.Range zeroRange,
                                       Excel.Range divRange, Excel.Range orcParamsRange)
        {
            var values = orcParamsRange.Value[System.Reflection.Missing.Value] as object[, ];

            values = (object[, ])DataRangeHelper.TrimNulls(values);
            var orcParams = RangeHelper.Convert2DArrayToClass <WingParamsRange>(ArrayHelper.RangeToMatrix(values));
            var zeroArray = zeroRange.Value[System.Reflection.Missing.Value] as object[, ];
            var zeroes    = ObjectToArrayOfPropertiesConverter.CreateListFromHorizontalArrayRange <ZeroCurveRange>(zeroArray);
            var divArray  = zeroRange.Value[System.Reflection.Missing.Value] as object[, ];
            var divs      = ObjectToArrayOfPropertiesConverter.CreateListFromHorizontalArrayRange <DividendRange>(divArray);
            var result    = Orion.EquityCollarPricer.Collar.CallCollarPricer(underlying, spot, callStrike,
                                                                             style, tradeDate, expiryDate,
                                                                             zeroes, divs, orcParams);

            return(result);
        }