I'm new to QuantLib, and I'm trying value a simple European call. QuantLib's Black-Scholes-Merton Process makes sense to me, but I don't know how to incorporate a discount curve into it.
Please see below for my current example in Python. Right now the process takes an index curve and a dividend curve. I need the process to take an index curve, dividend curve, and a discount curve. How can I accomplish this in QuantLib?
def call_atm_test():
"""Returns price of a european option using black-scholes"""
today = ql.Date(22, ql.May, 2019)
ql.Settings.instance().evaluationDate = today
option = ql.EuropeanOption(ql.PlainVanillaPayoff(ql.Option.Call, 2856.27),
ql.EuropeanExercise(ql.Date(22, ql.May, 2020)))
u = ql.SimpleQuote(2856.27)
r = ql.SimpleQuote(0.0223)
d = ql.SimpleQuote(0.01879)
sigma = ql.SimpleQuote(0.15259)
riskFreeCurve = ql.FlatForward(0, ql.TARGET(), ql.QuoteHandle(r), ql.Actual360())
dividend_yield = ql.FlatForward(0, ql.TARGET(), ql.QuoteHandle(d), ql.Actual360())
volatility = ql.BlackConstantVol(0, ql.TARGET(), ql.QuoteHandle(sigma), ql.Actual360())
process = ql.BlackScholesMertonProcess(ql.QuoteHandle(u),
ql.YieldTermStructureHandle(dividend_yield),
ql.YieldTermStructureHandle(riskFreeCurve),
ql.BlackVolTermStructureHandle(volatility))
engine = ql.AnalyticEuropeanEngine(process)
option.setPricingEngine(engine)
result = option.NPV()
return result