Posted by
Luigi Ballabio on
Mar 16, 2010; 8:01am
URL: http://quantlib.414.s1.nabble.com/Beginner-tutorial-in-progress-tp7306p7307.html
On Mon, 2010-03-15 at 22:49 -0400, Tawanda Gwena wrote:
> I am working on a beginner tutorial for quantlib. I don't want other
> people to go through the torture I did. At the moment it's very
> preliminary and full of mistakes (and downright lies). However I would
> like your feedback as I work on it over the next few weeks.
Great---let me know when you think I can put a link to it on the
QuantLib site.
A piece of feedback: you don't need to create a new process (and a new
engine) to change the underlying value. That's what quotes are about.
You create a process and set the engine once, with:
uQuote = SimpleQuote(underlying)
underlyingH = QuoteHandle(uQuote)
...
bsmProcess = BlackScholesMertonProcess(underlyingH,
dividendYield,
flatTermStructure,
flatVolTS)
europeanOption.setPricingEngine(AnalyticEuropeanEngine(bsmProcess))
after which, you just change the value in the quote and the option
recalculates automatically:
for x in range(20,60):
uQuote.setValue(x)
value = europeanOption.NPV()
Luigi
--
The young man knows the rules, but the old man knows the exceptions.
-- O. W. Holmes
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users