Calculates the theoretical implied volatility (IV) for a put option.
Namespace:
RightEdge.CommonAssembly: Common (in Common.dll) Version: 2010.1.0.0 (2010.1.0.0)
Syntax
| C# |
|---|
public double PutImpliedVolatility( double underlyingPrice, double strikePrice, int expirationMonth, int expirationYear, double optionPrice ) |
| Visual Basic (Declaration) |
|---|
Public Function PutImpliedVolatility ( _ underlyingPrice As Double, _ strikePrice As Double, _ expirationMonth As Integer, _ expirationYear As Integer, _ optionPrice As Double _ ) As Double |
| Visual C++ |
|---|
public: double PutImpliedVolatility( double underlyingPrice, double strikePrice, int expirationMonth, int expirationYear, double optionPrice ) |
Parameters
- underlyingPrice
- Type: System..::.Double
current price of the underlying asset
- strikePrice
- Type: System..::.Double
strike price of the option.
- expirationMonth
- Type: System..::.Int32
expiration month of the option.
- expirationYear
- Type: System..::.Int32
expiration year of the option.
- optionPrice
- Type: System..::.Double
the actual option price.
Return Value
the theoretical implied volatility.
Remarks
Implied volatility is the value used to determine if an option contract is over priced or under priced.
Implied volatility is the difference between the theoretical calculation and actual calculation. For example,
if an option with a current 10 period historical volatility of 21.59% is trading at 1.65, however, the
theoretical calculation estimates that the option is valued at 1.55 than this
implies that the volatility is actually 18.11% and this particular contract is potentially undervalued.
Examples
Get implied volatility for a put option (C#)
CopyC#
// Retrieve the current historical volatility based on an already created instance of the historical volatility indicator. ISeries hvSeries = Indicators["HV"][symbol]; double hvValue = hvSeries[hvSeries.Count - 1]; // Create an OptionCalculator instance with the historical volatility value OptionCalculator optionCalc = new OptionCalculator(hvValue); // Get the implied volatility for a put option that expires in 7/2006 with a strike price of 38.00 and a current market price of 0.725 double implVol = optionCalc.PutImpliedVolatility(bar.Close, 38.00, 7, 2006, 0.725); MessageBox.Show(implVol.ToString());