Skip to content

Calculate with P/L graph

POST/api/v1/calculate

Everything /pop returns, plus the profit/loss grid the calculator charts: P/L by stock price and date up to the earliest expiry.

  • Needs an API key
  • Counts as 2 requests

Request body

symbolstringoptional
Ticker, e.g. AAPL. Needed to fill in any price, IV or stock price you leave out.
legsarrayrequired
Up to 8 option legs and 1 stock leg.

Each leg is an object:

  • type: call, put or stock
  • action: buy or sell
  • quantity: contracts (100 shares each), or shares for a stock leg. Default 1, up to 1,000,000.
  • strike and expiry (YYYY-MM-DD): required for calls and puts
  • price: per share. Optional: left out, the current market price is used.
  • iv: implied volatility as a whole percent (e.g. 28.5). Optional: worked out from the price.
underlyingPricenumberoptional
Stock price to use. Default: the current price.
iv30numberoptional
30-day implied volatility, whole percent, used for the probability. Default: the stock's IV30.
priceMin, priceMaxnumberoptional
Price range for the grid. Default: automatic.
ivChangenumberoptional
Shift every implied volatility by this percent, e.g. -10.

Response

The fields in data. See requests and responses for the envelope and errors.

probabilityOfProfitnumber
Chance (0 to 1) of making at least $0.01 at the earliest expiry.
probabilityOf50PctMaxProfitnumber
Chance of reaching half the max profit. Also probabilityOf75PctMaxProfit and probabilityOfMaxProfit.
breakevensarray
Stock prices where the position breaks even at expiry, each with profitWhen (above, below or flat).
maxProfit, maxLossnumber
Dollars for the whole position. maxProfitUnlimited and maxLossUnlimited say when there is no limit.
netCostnumber
What the position costs to open, in dollars. Negative for a credit.
collateralnumber|null
Estimated margin for naked short options, in dollars.
underlyingPrice, volatilityUsednumber
The stock price and the IV the probability used.
evaluatedAtstring
The date the probability is for: the earliest expiry.
legsarray
Your legs with the prices and IVs used.
calculatorUrlstring|null
Opens the same position in the calculator, at the same prices. Null when the calculator can't open it from a link.
graph.pricesarray
Stock prices across the grid (columns).
graph.datesarray
Dates (rows): date, daysFromToday and atExpiry. The last is the earliest expiry.
graph.profitLossarray
profitLoss[d][p]: dollars if closed at prices[p] on dates[d].
graph.expiryobject
The expiry row: date and profitLoss.
graph.today, graph.entryCoststring, number
Today in New York, and what the position cost to open.