Pricing Geometric Asian Calls with QuantLib
Summary
The answer shows how to price a European average-price call option using QuantLib’s continuous geometric averaging Asian option class. It sets up a call payoff and European exercise date, then supplies an initial asset value, constant volatility, and flat risk-free yield curve within a Black-Scholes process. An analytic pricing engine for continuously averaged geometric Asian options returns the net present value.
The example is specifically for a geometric average and continuous averaging, despite the question asking generally about an average-price option. It does not demonstrate an arithmetic-average contract, discrete observation dates, calibration to market data, or alternative models. The parameter values are illustrative inputs rather than evidence of market accuracy, and the response supplies no research references or comparison with other pricing methods.
Key ideas
- QuantLib provides an analytic engine for continuously averaged geometric Asian options.
- The example configures a European call payoff and an exercise date within a Black-Scholes process.
- The demonstrated contract uses geometric continuous averaging, not every average-price option structure.
- The sample inputs are illustrative and do not establish market calibration or pricing accuracy.
Tags
Full text
# Software implementation for valuation of exotic options
# Software implementation for valuation of exotic options
I am looking for some software implementation of pricing `Average Price Call option (APO)` mostly Python (or any other package.)
Exercise style is `European` only.
Also, any link to any research paper for pricing such option much appreciated.
Many thanks,
## Answer by David Duarte (score 4, accepted)
https://quant.stackexchange.com/a/55153
Give QuantLib a try:
```
import QuantLib as ql
today = ql.Settings.instance().evaluationDate
averageType = ql.Average.Geometric
option_type = ql.Option.Call
strike = 120.0
exerciseDate = ql.TARGET().advance(today, 90, ql.Days)
payoff = ql.PlainVanillaPayoff(option_type, strike)
exercise = ql.EuropeanExercise(exerciseDate)
option = ql.ContinuousAveragingAsianOption(averageType, payoff, exercise)
initialValue = ql.QuoteHandle(ql.SimpleQuote(100))
sigma = 0.2
riskFreeTS = ql.YieldTermStructureHandle(ql.FlatForward(today, 0.05, ql.Actual365Fixed()))
volTS = ql.BlackVolTermStructureHandle(ql.BlackConstantVol(today, ql.NullCalendar(), sigma, ql.Actual365Fixed()))
stochProcess = ql.BlackScholesProcess(initialValue, riskFreeTS, volTS)
engine = ql.AnalyticContinuousGeometricAveragePriceAsianEngine(stochProcess)
option.setPricingEngine(engine)
price = option.NPV()
print(f"Option price: {price}")
```Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.