mafipy.function.payoff_bull_spread¶
-
mafipy.function.
payoff_bull_spread
(underlying, lower_strike, upper_strike, gearing=1.0)[source]¶ Buy call option with lower_strike \(K_{\mathrm{lower}}\) and sell put option with upper_strike \(K_{\mathrm{upper}}\). As the name denotes, lower_strike is lower than upper_strike. Payoff formula is as follows:
\[g(\max(S - K_{\mathrm{lower}}, 0) - \min(S - K_{\mathrm{upper}}, 0)) = g\min(K_{\mathrm{upper}}, \max(S - K_{\mathrm{lower}}))\]where \(S\) is underlying, \(g\) is gearing.
Parameters: - underlying (float) –
- lower_strike (float) –
- upper_strike (float) –
- gearing (float) – coefficient of this option. Default value is 1.
Returns: payoff of bull spread option. If lower_strike >= upper_strike, then return 0.
Return type: float