Esempio n. 1
0
        public LookbackOptionCalculator(
            OptionType optionType, InstrumentType underlyingProductType, StrikeStyle strikeStyle,
            double strike, double spotPrice,
            double exerciseInYears, double realizedMaxPrice, double realizedMinPrice,
            double sigma, double riskFreeRate, double dividendRate, double notional)
        {
            _optionType  = optionType;
            _strikeStyle = strikeStyle;
            _X           = strike;
            _S           = spotPrice;
            _Smin        = realizedMinPrice;
            _Smax        = realizedMaxPrice;
            _T           = exerciseInYears;

            _sigma        = sigma;
            _r            = riskFreeRate;
            _dividendRate = dividendRate;

            if (FuturesProducts.Contains(underlyingProductType))
            {
                _b = 0.0;
            }
            else
            {
                _b = riskFreeRate - dividendRate;
            }

            _notional = notional;
        }
Esempio n. 2
0
 public LookbackOption(Date startDate,
                       Date maturityDate,
                       OptionExercise exercise,
                       OptionType optionType,
                       StrikeStyle strikeStyle,
                       double strike,
                       InstrumentType underlyingInstrumentType,
                       ICalendar calendar,
                       IDayCount dayCount,
                       CurrencyCode payoffCcy,
                       CurrencyCode settlementCcy,
                       Date[] exerciseDates,
                       Date[] observationDates,
                       Dictionary <Date, double> fixings,
                       double notional                      = 1,
                       DayGap settlementGap                 = null,
                       Date optionPremiumPaymentDate        = null,
                       double optionPremium                 = 0,
                       bool isMoneynessOption               = false,
                       double initialSpotPrice              = 0.0,
                       Dictionary <Date, double> dividends  = null,
                       bool hasNightMarket                  = false,
                       bool commodityFuturesPreciseTimeMode = false
                       )
     : base(startDate, maturityDate, exercise, optionType, new double[] { strike }, underlyingInstrumentType, calendar, dayCount,
            settlementCcy, payoffCcy, exerciseDates, observationDates, notional, settlementGap,
            optionPremiumPaymentDate, optionPremium,
            isMoneynessOption: isMoneynessOption, initialSpotPrice: initialSpotPrice, dividends: dividends, hasNightMarket: hasNightMarket,
            commodityFuturesPreciseTimeMode: commodityFuturesPreciseTimeMode)
 {
     Fixings     = fixings;
     StrikeStyle = strikeStyle;
 }
Esempio n. 3
0
        public AsianOptionCalculator(
            OptionType optionType, AsianType asianType, InstrumentType underlyingProductType, StrikeStyle strikeStyle,
            double strike, double spotPrice, double realizedAveragePrice,
            double exerciseInYears, double originalAveragePeriod, double timetoNextAveragePoint,
            double sigma, double riskFreeRate, double dividendRate, double notional, double numOfObsDates, double numOfObservedDates)
        {
            _optionType   = optionType;
            _asianType    = asianType;
            _strikeStyle  = strikeStyle;
            _X            = strike;
            _S            = spotPrice;
            _SA           = realizedAveragePrice;
            _T            = exerciseInYears;
            _T2           = originalAveragePeriod;
            _t1           = timetoNextAveragePoint;
            _sigma        = sigma;
            _r            = riskFreeRate;
            _dividendRate = dividendRate;

            if (FuturesProducts.Contains(underlyingProductType))
            {
                _b = 0.0;
            }
            else
            {
                _b = riskFreeRate - dividendRate;
            }

            _notional           = notional;
            _numOfObsDates      = numOfObsDates;
            _numOfObservedDates = numOfObservedDates;
        }