April 2019
Intermediate to advanced
426 pages
11h 13m
English
Just as we did for near-term options, calculating the next-term options is pretty straightforward with the following Python calls to the functions already defined in place:
In [ ] : df_next = chain.get(dt_next) f2 = determine_forward_level(df_next, r, t2) k0_next = find_k0(df_next, f2) (k_lower_next, k_upper_next) = \ find_lower_and_upper_bounds(df_next, k0_next) pd_contrib_next = tabulate_contrib_by_strike( df_next, k0_next, k_lower_next, k_upper_next, r, t2) volatility_next = calculate_volatility( pd_contrib_next, t2, f2, k0_next)In [ ]: print('volatility_next:', volatility_next)Out[ ]: volatility_next: 0.04524308316212813982254693873
Since dt_next is our next-term maturity date, calling chain.get() ...
Read now
Unlock full access