/// <summary>Determines whether a volatility should be computable that implies a specified option value. /// </summary> /// <param name="optionValue">The option value.</param> /// <param name="option">The option.</param> /// <returns> /// <c>true</c> if there should be an implied volatility for the specified option value be available; otherwise, <c>false</c>. /// </returns> /// <remarks>The implied volatility of Far-out-of-the-money options can often not be computed. One can design the individual test cases or one may override this /// method in an individual manner to avoid questionable results in the unit tests.</remarks> protected override bool IsVolatilityInvertibleOptionValue(double optionValue, IConstantVolatilityStandardEuropeanOption option) { /* the option value should be >= 0 and the option price should not be the intrinsic value, see for example the remarks in * 'Numerical approximation of the implied volatility under arithmetic Brownian motion', J. Choi, K. Kim, M. Kwak (2007), * applied to a digital option. */ return(base.IsVolatilityInvertibleOptionValue(optionValue, option) && (optionValue != option.GetIntrinsicValue())); }
/// <summary>Determines whether a volatility should be computable that implies a specified option value. /// </summary> /// <param name="optionValue">The option value.</param> /// <param name="option">The option.</param> /// <returns> /// <c>true</c> if there should be an implied volatility for the specified option value be available; otherwise, <c>false</c>. /// </returns> /// <remarks>The implied volatility of Far-out-of-the-money options can often not be computed. One can design the individual test cases or one may override this /// method in an individual manner to avoid questionable results in the unit tests.</remarks> protected virtual bool IsVolatilityInvertibleOptionValue(double optionValue, IConstantVolatilityStandardEuropeanOption option) { return(optionValue > MachineConsts.SuperTinyEpsilon); }
/// <summary>Returns a <see cref="IEuropeanOptionPricer"/> object that encapsulate the current instance. /// </summary> /// <param name="constantVolatilityStandardEuropeanOption">A specified European option based on a model with a constant volatility (i.e. Black, Bachelier etc.).</param> /// <param name="volatility">The volatility parameter.</param> /// <returns></returns> public static IEuropeanOptionPricer AsEuropeanOptionPricer(this IConstantVolatilityStandardEuropeanOption constantVolatilityStandardEuropeanOption, double volatility) { return(new Wrapper(constantVolatilityStandardEuropeanOption, volatility)); }
/// <summary>Determines whether a volatility should be computable that implies a specified option value. /// </summary> /// <param name="optionValue">The option value.</param> /// <param name="option">The option.</param> /// <returns> /// <c>true</c> if there should be an implied volatility for the specified option value be available; otherwise, <c>false</c>. /// </returns> /// <remarks>The implied volatility of Far-out-of-the-money options can often not be computed. One can design the individual test cases or one may override this /// method in an individual manner to avoid questionable results in the unit tests.</remarks> protected override bool IsVolatilityInvertibleOptionValue(double optionValue, IConstantVolatilityStandardEuropeanOption option) { /* the option value should be >= 0 and the (undiscounted) option price should not be Strike-Forward, see remarks in * 'Numerical approximation of the implied volatility under arithmetic Brownian motion', J. Choi, K. Kim, M. Kwak (2007) * and apply the call-put parity. */ return(base.IsVolatilityInvertibleOptionValue(optionValue, option) && (optionValue / option.DiscountFactor != option.Strike - option.Forward)); }
internal Wrapper(IConstantVolatilityStandardEuropeanOption standardOption, double volatility) { m_StandardOption = standardOption; m_Volatility = volatility; }