Pull AAPL option prices with OpenBB and chart the payoff in NumPy.
By PyQuant News
Published: 2026-10-10
URL: https://pyquantnews.substack.com/p/use-python-to-analyze-options-straddles
Each week, I send out one Python tutorial to help you get started with algorithmic trading, market data analysis, and quant finance. Upgrade to a paid plan to access the Python code notebooks, Discord community, and code support.
You can price a real options strategy in about twenty lines of Python.
Most beginners assume options are too complicated to touch until they understand every pricing formula. But the arithmetic behind the most common strategies is addition and subtraction. What matters first is where a trade starts making money.
So people spend months reading theory and never once plot the profit and loss of a trade they could actually place.
A trade I misread
I once bought a call (the right to buy a stock) and a put (the right to sell it) on the same stock ahead of an earnings report. The stock moved, and I still lost money, because both options got cheaper once the news was out.
Most beginners do the same thing. They buy options because they expect movement, without checking how far the price has to travel.
Professional options traders chart the profit and loss at every possible stock price before they place the order.
What you’ll build
In today’s post, you’ll pull option prices with Python and chart exactly where a straddle breaks even, meaning the stock prices at which the trade stops losing money.
Let’s go.
