Inputs and Time Steps in a Dividend-Aware American Option Model
Summary
The document presents QuantLib code that constructs a Black–Scholes process and an American-style vanilla option with specified dividend dates and amounts. The pricing function accepts a valuation date, expiry, call or put designation, strike, time-step count, and process, then attaches a finite-difference engine. It is framed as a beginner’s request for clarification of three inputs: the risk-free rate, dividend information, and time steps.
The code indicates that the rate is supplied through a flat yield curve, volatility through a constant-volatility curve, and the underlying price through a quote handle. Dividends are passed directly to the dividend option, while the time-step argument determines the temporal mesh used by the engine; the code also sets grid points to one less than the time steps. No numerical example, Greek calculation, accuracy comparison, or practical guidance on choosing these inputs is provided. The implementation is therefore an illustration of model setup, not evidence about the sensitivity or reliability of the resulting Greeks.
Key ideas
- The code builds a Black–Scholes process using spot, a flat rate curve, and constant volatility.
- The American option includes explicit dividend dates and dividend amounts.
- The finite-difference engine receives a time-step count and a spatial grid size derived from it.
- The document raises questions about interpreting the rate, dividends, and time discretization but does not answer them.
Tags
Full text
# Generating Greeks with American Options
# Generating Greeks with American Options
Investor and Software Engineer but very new to quant finance here...
I have the below code (which I'm sure will be helpful for some) and have some questions regarding the function parameters!
- Is RF Rate your interest rate on treasuries? Basically your no risk competing return?
- How much will dividends influence the greeks? It is additional data I might not have access to?
- What are the time steps? I don't understand the wording...
```
def create_american_process(valuation_date, rf_rate, spot, ivol):
#set calendar & day count
calendar = ql.UnitedStates()
day_counter = ql.ActualActual()
#set evaluation date
ql.Settings.instance().evaluationDate = valuation_date
#set rate & vol curves
rate_ts = ql.FlatForward(valuation_date, ql.QuoteHandle(rf_rate),
day_counter)
vol_ts = ql.BlackConstantVol(valuation_date, calendar,
ql.QuoteHandle(ivol), day_counter)
#create process
process = ql.BlackScholesProcess(ql.QuoteHandle(spot),
ql.YieldTermStructureHandle(rate_ts),
ql.BlackVolTermStructureHandle(vol_ts))
return process
def american_px_greeks(valuation_date, expiry, call_or_put, strike, div_dates,
div_values, time_steps, process):
#create instance as call or put
if call_or_put.lower() == 'call':
option_type = ql.Option.Call
elif call_or_put.lower() == 'put':
option_type = ql.Option.Put
else:
raise ValueError("The call_or_put value must be call or put.")
#set exercise and payoff
exercise = ql.AmericanExercise(valuation_date, expiry)
payoff = ql.PlainVanillaPayoff(option_type, strike)
#create option instance
option = ql.DividendVanillaOption(payoff, exercise, div_dates, div_values)
#set mesh size for finite difference engine
grid_points = time_steps - 1
#create engine
engine = ql.FDDividendAmericanEngine(process, time_steps, grid_points)
option.setPricingEngine(engine)
return option
```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.