1

I am trying to price a European FX call option using QuantLib in Python.

The domestic risk-free rate is 0.16%. The foreign risk-free rate is -0.46%. The valuation date is 30 June 2020. The deal date is 25 June 2020. The exercise date is 2 July 2020. The volatility is 9.935%.

It has a strike of 1.122 and a spot exchange rate of 1.12385.

The codes are as follows:

import QuantLib as ql
calculation_date = ql.Date(30, 6, 2020)
ql.Settings.instance().evaluationDate = calculation_date
rf_domestic = 0.16 # in %
rf_foreign = -0.46 # in %
usd_domestic = ql.YieldTermStructureHandle(ql.FlatForward(calculation_date, rf_domestic/100, ql.ActualActual()))
eur_foreign = ql.YieldTermStructureHandle(ql.FlatForward(calculation_date, rf_foreign/100, ql.ActualActual()))
volTS = ql.BlackVolTermStructureHandle(ql.BlackConstantVol(ql.Date(30, 6, 2020), ql.NullCalendar(), 9.935/100, ql.ActualActual()))
gkp = ql.GarmanKohlagenProcess(ql.QuoteHandle(ql.SimpleQuote(1.122)), usd_domestic, eur_foreign, volTS)
engine = ql.BinomialVanillaEngine(gkp, 'crr', 1000)
option = ql.EuropeanOption(ql.PlainVanillaPayoff(ql.Option.Call, 1.12385), ql.EuropeanExercise(ql.Date(2, 7, 2020))) 
option.setPricingEngine(engine)
print('NPV:', option.NPV())
print('Diffusion:', gkp.diffusion(t, x))
print('Drift:', gkp.drift(t, x))
print('Variance:', gkp.variance(t0, x0, dt))
print('Standard Deviation:', gkp.stdDeviation(t0, x0, dt))
print('Expectation:', gkp.expectation(t0, x0, dt))

For the computation of drift, diffusion, variance, standard deviation and expectation (last 5 lines of the above codes), what should the parameters (t, x, dt, t0) be?

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
ql.user2511
  • 369
  • 2
  • 12

1 Answers1

0

Provide the t and x values. A bit weird that the output is the same for any values of t or x. E.g.

print('Diffusion:', gkp.diffusion(1, 1))
print('Diffusion:', gkp.diffusion(2, 2))