Implied Volatility

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Implied Volatility

Sumit Gupta-5
I am trying to use the Implied Volatility function of QLNet and able to get the value of European Options. However, I noticed that implied volatility for American (CRR) is not implemented. Can any one guide me how to use the given function for American (CRR) options?

Also, I noticed that European IV didnt match with www.ASX.com.au. Please advice about the possible cause for the differences.

Please reply.

Regards,
Sumit Gupta

------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
xnb
Reply | Threaded
Open this post in threaded view
|

Re: Implied Volatility

xnb
This post was updated on .
I face this problem too, any one have idea? thx


my code:

Exercise exerciseEngine = new AmericanExercise(SettlementDate, Maturity);

VanillaOption optionEngine = new VanillaOption(payoff, exerciseEngine);

optionEngine.setPricingEngine(new BinomialVanillaEngine<CoxRossRubinstein>(bsmProcess, timeSteps));

optionEngine.impliedVolatility(targetValue, bsmProcess, accuracy, maxEvaluations, minVol, maxVol);


underlying = 100,
k=101,
i=0.08,
vol=0.2,
div=0,
todaysDate & settlementdate = 2012-12-18,
maturity = 2013-01-18,
int timeSteps = 801;
double accuracy = 1.0e-4;
int maxEvaluations = 100;
double minVol = 1.0e-7;
double maxVol = 4.0;
double targetValue = optionEngine .NPV();


In **VanillaOption.cs**, the code of case Exercise.Type.American is uncomment;

The error message is: **An item with the same key has already been added**.
at line 111 (results.additionalResults.Add priceCurve, prices_) in **FDStepConditionEngine.cs**

Thanks for kindly help.

 
Reply | Threaded
Open this post in threaded view
|

Re: Implied Volatility

wood.vi
OP got his answer at http://stackoverflow.com/questions/13928690/qlnet-implied-volatility.  As of 2012-Dec, there was a problem with the C# port.
Reply | Threaded
Open this post in threaded view
|

Re: Implied Volatility

dpuschmann
In reply to this post by xnb
There seems to be a bug in the FDStepConditionEngine.cs, which can be solved by inserting

results.additionalResults.Clear();

before the original line 111:
results.additionalResults.Add("priceCurve", prices_);

This seems to be correct, since the other results (value/delta/gamma) are simply overwritten in this method, so there seems to be no sense in storing thepricecurve of past calculations.