You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great tutorial by the way.
I think you have an error in the plot for the bull call spread. Using the conditions you have in the paragraph before the plot, the spread should be a net debit which is also the max loss of the spread. In other words, the short call, higher strike price, offsets the long call, lower strike price. It should cost you money to buy the spread. The plot should reflect that as -18 or -20+2 until the underlying stock price starts to approach the lower strike price in your plot. The python code has 'premium', which is undefined in your code snippet. It should be the corresponding premium for the options involved in the spread, btw, sorry about weird format:
# long call with lower strike
payoff_long_call = [max(-premium, i-k_low-premium_low ) for i in price]
# short call with higher strike
payoff_short_call = [min(premium, -(i-k_high-premium_high)) for i in price]
#Should Be:
# long call with lower strike
payoff_long_call = [max(-premium_low, i-k_low-premium_low ) for i in price]
# short call with higher strike
payoff_short_call = [min(premium_high, -(i-k_high-premium_high)) for i in price]
Also, since this is a debit spread, it may help to 'mark' the breakeven point along with corresponding strike price.
I used this for that:
plt.text(k_low+premium_low-premium_high+5, -10, "BreakEven Stock Price, " + str(k_low+premium_low-premium_high))
plt.scatter(k_low+premium_low-premium_high, 0, c='green')
Great tutorial by the way.
I think you have an error in the plot for the bull call spread. Using the conditions you have in the paragraph before the plot, the spread should be a net debit which is also the max loss of the spread. In other words, the short call, higher strike price, offsets the long call, lower strike price. It should cost you money to buy the spread. The plot should reflect that as -18 or -20+2 until the underlying stock price starts to approach the lower strike price in your plot. The python code has 'premium', which is undefined in your code snippet. It should be the corresponding premium for the options involved in the spread, btw, sorry about weird format:
# long call with lower strike
payoff_long_call = [max(-premium, i-k_low-premium_low ) for i in price]
# short call with higher strike
payoff_short_call = [min(premium, -(i-k_high-premium_high)) for i in price]
#Should Be:
# long call with lower strike
payoff_long_call = [max(-premium_low, i-k_low-premium_low ) for i in price]
# short call with higher strike
payoff_short_call = [min(premium_high, -(i-k_high-premium_high)) for i in price]
Also, since this is a debit spread, it may help to 'mark' the breakeven point along with corresponding strike price.
I used this for that:
plt.text(k_low+premium_low-premium_high+5, -10, "BreakEven Stock Price, " + str(k_low+premium_low-premium_high))
plt.scatter(k_low+premium_low-premium_high, 0, c='green')
Link to example page.
https://www.quantconnect.com/tutorials/applied-options/bull-call-spread#Bull-Call-Spread-Algorithm
The text was updated successfully, but these errors were encountered: