Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in plot of bull call spread. #362

Open
startrigger opened this issue Jan 16, 2022 · 0 comments
Open

Error in plot of bull call spread. #362

startrigger opened this issue Jan 16, 2022 · 0 comments

Comments

@startrigger
Copy link

startrigger commented Jan 16, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant