DEV Community

Daniel Oliveira
Daniel Oliveira

Posted on

How to draw an options strategy payoff with an AI agent, from a real option chain

All outputs are real tool calls to the Equibles MCP server from 21 October 2026, trimmed.

A payoff diagram answers one question: if I hold this position to expiration, what do I make or lose at each price? Drawing one needs only strikes and premiums. The fiddly part is getting real premiums for the right expiration, and an agent with market data does that part in one call.

Here's the workflow with Apple options expiring 20 November 2026, priced at the 20 October close, for two strategies: a bull call spread and an iron condor.

Connect it first

In Claude, open Customize → Connectors → Discover, search for Equibles, click Connect to Claude and Authorize, then switch it on in a chat from + → Connectors. In ChatGPT: Plugins, search Equibles, Install plugin. In Claude Code, claude mcp add --transport http equibles https://mcp.equibles.com/mcp and then /mcp to sign in. The free plan covers 100 requests a day with end-of-day option data; Plus adds a 15-minute delayed bid and ask, and Pro real-time quotes. Other clients are in the setup docs.

1. Pick the expiration

"Using Equibles, list AAPL option expirations." GetOptionExpirations returns 23 dates, from 21 October 2026 to 19 January 2029, with the contract count at each. I take 20 November 2026, the monthly expiration about a month out, with 188 contracts.

2. Pull the strikes you need

"Show the AAPL chain for 20 November, strikes 300 to 380." GetOptionChain with expiration, minStrike and maxStrike. AAPL closed at $339.50 on 20 October. The rows I use, trimmed to what a payoff needs:

Strike Type Bid Ask Open interest
310 Put 2.18 2.30 16,943
320 Put 3.80 4.00 11,502
340 Call 10.70 11.00 14,769
340 Put 10.00 10.50 12,251
360 Call 3.05 3.25 21,813
370 Call 1.35 1.45 17,894

Two habits before any math:

  • Check the session. Each row says which trading session its last price and volume came from. Several strikes in this chain last traded on earlier days, one as far back as 1 October, so their "last" is stale. I only used strikes whose session is 20 October.
  • Price from bid and ask, never the last trade. I use the conservative fill: buy at the ask, sell at the bid. Every figure below uses it.

3. Strategy one: a bull call spread

Buy the 340 call at $11.00, sell the 360 call at $3.05.

  • Net debit: $7.95 a share, $795 per spread (one contract is 100 shares). That's the most it can lose.
  • Max gain: the $20 width minus the debit, $12.05, so $1,205, at $360 or above.
  • Breakeven at expiration: $347.95, 2.5% above the close.

4. Strategy two: an iron condor

Sell the 320 put at $3.80 and buy the 310 put at $2.30; sell the 360 call at $3.05 and buy the 370 call at $1.45.

  • Net credit: $3.10, so $310 per condor. That's the most it can make, kept if AAPL ends between $320 and $360.
  • Max loss: the $10 wing width minus the credit, $6.90, so $690, below $310 or above $370.
  • Breakevens: $316.90 and $363.10, 6.7% below and 7.0% above the close.

5. Tabulate the payoff

"Tabulate both at expiration for prices from 300 to 380, including the breakevens."

AAPL at expiry vs close Bull call spread Iron condor
$300.00 -11.6% -$795 -$690
$310.00 -8.7% -$795 -$690
$316.90 -6.7% -$795 $0
$320.00 -5.7% -$795 +$310
$330.00 -2.8% -$795 +$310
$340.00 +0.1% -$795 +$310
$347.95 +2.5% $0 +$310
$350.00 +3.1% +$205 +$310
$355.00 +4.6% +$705 +$310
$360.00 +6.0% +$1,205 +$310
$363.10 +7.0% +$1,205 $0
$370.00 +9.0% +$1,205 -$690
$380.00 +11.9% +$1,205 -$690

6. Draw it

"Write matplotlib code that plots both payoffs." Claude can run this itself when code execution is on, or you can paste it into any Python with numpy and matplotlib:

import numpy as np
import matplotlib.pyplot as plt

# AAPL options expiring 2026-11-20, priced at the 20 Oct close:
# buy at the ask, sell at the bid. (type, strike, +1 buy / -1 sell, premium)
strategies = {
    "Bull call spread 340/360": [("call", 340, +1, 11.00), ("call", 360, -1, 3.05)],
    "Iron condor 310/320/360/370": [("put", 310, +1, 2.30), ("put", 320, -1, 3.80),
                                    ("call", 360, -1, 3.05), ("call", 370, +1, 1.45)],
}

def payoff(price, legs):
    total = np.zeros_like(price)
    for kind, strike, qty, premium in legs:
        if kind == "call":
            intrinsic = np.maximum(price - strike, 0)
        else:
            intrinsic = np.maximum(strike - price, 0)
        total += qty * (intrinsic - premium) * 100  # one contract = 100 shares
    return total

price = np.linspace(295, 385, 500)
fig, ax = plt.subplots(figsize=(8, 4.5))
for (name, legs), color in zip(strategies.items(), ["#2a78d6", "#eb6834"]):
    ax.plot(price, payoff(price, legs), color=color, linewidth=2, label=name)

ax.axhline(0, color="#8c8b84", linewidth=1)
ax.axvline(339.50, color="#8c8b84", linewidth=1, linestyle=":")
ax.annotate("AAPL close $339.50", (339.50, 1250), xytext=(4, 0),
            textcoords="offset points", fontsize=9, color="#3d3d3a")
ax.grid(axis="y", color="#e1e0d9", linewidth=0.8)
ax.spines[["top", "right"]].set_visible(False)
ax.set_xlabel("AAPL price at expiration on 20 Nov 2026 ($)")
ax.set_ylabel("Profit or loss per position ($)")
ax.legend(frameon=False, loc="upper left")
fig.tight_layout()
fig.savefig("aapl-payoff.png", dpi=150)
Enter fullscreen mode Exit fullscreen mode

The output:

Payoff at expiration of an AAPL 340/360 bull call spread and a 310/320/360/370 iron condor, 20 November 2026

To draw any other strategy, change the legs. A straddle is two lines: ("call", 340, +1, 11.00), ("put", 340, +1, 10.50).

7. Size it against what the market prices

That straddle, buying the 340 call and the 340 put at the ask, costs $21.50, about 6.3% of the share price. A straddle's cost is the usual rule of thumb for the move the options market expects by expiration. The condor's breakevens sit just outside it, at -6.7% and +7.0%; the bull spread needs +2.5% to break even.

One more check. "When is Apple's next earnings call?" GetUpcomingInvestorEvents has no upcoming event on Apple's IR calendar yet; the last call on record was on 30 July. If the next one falls before 20 November, these premiums already price it in, so confirm the date before relying on the table.

The prompt I reuse

Using Equibles, for <TICKER> options expiring <DATE>:
1. Pull the chain for strikes within 15% of the last close; keep only
   rows whose session is the latest trading day.
2. Price <STRATEGY> buying at the ask and selling at the bid.
3. Give max gain, max loss, breakevens, and a payoff table at expiration.
4. Write matplotlib code that plots it, and give the at-the-money
   straddle cost as a percent of the price.
Enter fullscreen mode Exit fullscreen mode

What a payoff diagram can't tell you

  • The path. It shows value at expiration only. Before then, the position moves with time and implied volatility, and a spread can be underwater mid-way even if it ends in profit.
  • Assignment. US equity options are American style, so a short leg can be assigned early, most often a short call just before an ex-dividend date.
  • Fills and costs. Real fills often land between the bid and the ask, so buying at the ask and selling at the bid is the cautious case. Commissions aren't included.

The whole chain, with open interest and every expiration, is on the AAPL options chain page.

Nothing here is investment advice.

Top comments (0)