Re: How to price the arithmetic option using python quantlib
Posted by
Luigi Ballabio on
Apr 14, 2017; 2:11pm
URL: http://quantlib.414.s1.nabble.com/How-to-price-the-arithmetic-option-using-python-quantlib-tp18180p18194.html
If you're asking for the next step, that would be
option.setPricingEngine(engine)
print option.NPV()
If you tried that and didn't work, it might be because you're not defining any fixing dates, and a discrete-averaging Asian option needs some.
If it still doesn't work, please attach a complete example.
Luigi
I tried many times, but it went wrong and i don't know how to fix it.
I used the DiscreteAveragingAsianOption method to price the arithmetic
option where i used the MCDiscreteArithmeticAPEngine to generize the Monte
Carlo path of Underlying prices. But I cann't correctly quote the two
functions. If there are any python docs or examples to price the arithmetc
option?
I searched the internet for a long time with little materials.Some of my
codes are as follows:
process2 = GeneralizedBlackScholesProcess(QuoteHandle(underlying),
YieldTermStructureHandle(dividendYield),
YieldTermStructureHandle(riskFreeRate),
BlackVolTermStructureHandle(volatility))
#asian settings
averageType = Average().Arithmetic
runningAccumulator = 1
pastFixings = 0
fixingDates = []
isBrownianbridge = False
isAntitheticvariate = True
isControlvariate = False
requiredSamples = 10000
requiredTolerance = 1e-3
maxSamples = 100000
seed = 42
enginestr = 'pr'
option = DiscreteAveragingAsianOption(averageType, runningAccumulator,
pastFixings, fixingDates, payoff, excercise)
engine = MCDiscreteArithmeticAPEngine(process2, enginestr, isBrownianbridge,
isAntitheticvariate, isControlvariate, requiredSamples, requiredTolerance,
maxSamples, seed)
Plz tell what's wrong or how to quote the two functions!!
--
View this message in context: http://quantlib.10058.n7.nabble.com/How-to-price-the-arithmetic-option-using-python-quantlib-tp18180.html
Sent from the quantlib-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org!
http://sdm.link/slashdot_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users