/// <summary> /// Initializes a new instance of the <see cref="PriceableSimpleOptionAsset"/> class. /// </summary> /// <param name="cache">The cache.</param> /// <param name="logger">The logger.</param> /// <param name="nameSpace">The client namespace</param> /// <param name="baseDate">The base date.</param> /// <param name="expiryTenor">The expiry tenor.</param> /// <param name="underlyingAssetIdentifier">The underlying asset.</param> /// <param name="strike">The strike.</param> /// <param name="volatility">The volatility.</param> /// <param name="forecastCurve">The forecast rate curve.</param> /// <param name="discountCurve">The discount rate curve. Not used yet, as only the implied rate is caclulated.</param> /// <param name="fixingCalendar">The fixingCalendar.</param> /// <param name="rollCalendar">The rollCalendar.</param> public PriceableSimpleOptionAsset(ILogger logger, ICoreCache cache, string nameSpace, String underlyingAssetIdentifier, DateTime baseDate, Period expiryTenor, Decimal?strike, Decimal volatility, IRateCurve discountCurve, ICurve forecastCurve, IBusinessCalendar fixingCalendar, IBusinessCalendar rollCalendar) { UnderlyingAssetRef = underlyingAssetIdentifier; var expiryOffset = new Offset { period = expiryTenor.period, periodMultiplier = expiryTenor.periodMultiplier, periodSpecified = true, dayType = DayTypeEnum.Calendar, dayTypeSpecified = true }; var expiryDate = expiryOffset.Add(baseDate); var assetProperties = PriceableAssetFactory.BuildPropertiesForAssets(nameSpace, underlyingAssetIdentifier, expiryDate); var instrument = InstrumentDataHelper.GetInstrumentConfigurationData(cache, nameSpace, underlyingAssetIdentifier); var quotation = BasicQuotationHelper.CreateRate(0.05m); var quote = BasicAssetValuationHelper.Create(quotation); UnderlyingPriceableAsset = PriceableAssetFactory.Create(logger, cache, nameSpace, instrument, quote, assetProperties, fixingCalendar, rollCalendar); BaseDate = baseDate; ForwardIndex = UnderlyingPriceableAsset.CalculateImpliedQuote(forecastCurve); if (strike != null) { Strike = (Decimal)strike; } else { Strike = ForwardIndex; } DayCounter = new Actual365(); ExpiryDate = expiryDate; Volatility = volatility; TimeToExpiry = DayCounter.DayCount(BaseDate, ExpiryDate); }