I'm trying to implement BlackProcess with Quantlib (in C#) and the result I get for NPV() is not inline with some resources I can find online. Here is my code:
var underlyingH = new Handle<Quote>(new SimpleQuote(27.77)); var underlierVolatility = 0.22; var dayCounter = new Actual365Fixed(); var settlementDate= DateTime.UtcNow; var flatTermStructure = new Handle<YieldTermStructure>(new FlatForward(settlementDate, 0.001, dayCounter)); var flatVolTs = new Handle<BlackVolTermStructure>(new BlackConstantVol(settlementDate, calendar, underlierVolatility, dayCounter )); var computationEngine = new BlackProcess(underlyingH, flatTermStructure, flatVolTs); // Option var payoff = new PlainVanillaPayoff(type, (double)option.Instrument.Strike); var europeanOption = new VanillaOption(payoff, new EuropeanExercise(option.Instrument.Expiry.DateTime)); // Black-76 on european option europeanOption.setPricingEngine(new AnalyticEuropeanEngine(computationEngine));
The resources I use to compare my result are: http://lombok.demon.co.uk/financialTap/options/bond/shortterm https://commoditymodels.files.wordpress.com/2012/07/black-76-calculator.xls
My question is: What can create a difference in NPV (1-2% diff) in the result I get form QuantLib according to vanilla engines we can find online?
I suspect a mistake in the way I use the different "parameters" like:
- Actual365 calendar
I admit having expected very (very) close results.