# Options Strategy Calculator (`xprm-llc/options-strategy-calculator`) Actor

Max profit, max loss, breakevens, ROC/annualized and Black-Scholes probability of profit for 9 options strategies. Your prices, pure math, no data feed.

- **URL**: https://apify.com/xprm-llc/options-strategy-calculator.md
- **Developed by:** [Paul Scharr](https://apify.com/xprm-llc) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 50.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Options Strategy Calculator

> **Educational, not advice.** This Actor does math on numbers *you* type in. It fetches no market data and gives no trade recommendations. Real results differ because of early assignment, dividends, fees, slippage and IV changes.

Work out max profit, max loss, breakevens, return on capital (raw and annualized), and Black-Scholes probability of profit / probability ITM for common options strategies. You can run one calculation or a batch of up to 100 in a single run.

### Supported strategies (`strategy`)

| Value | Required fields |
|---|---|
| `cash_secured_put` | putStrike, putPremium |
| `covered_call` (wheel) | stockCostBasis, callStrike, callPremium, optional priorPremiumsCollected |
| `bull_call_spread` / `bear_put_spread` (debit) | longStrike, longPremium, shortStrike, shortPremium |
| `bear_call_spread` / `bull_put_spread` (credit) | shortStrike, shortPremium, longStrike, longPremium |
| `iron_condor` | longPutStrike/Premium, shortPutStrike/Premium, shortCallStrike/Premium, longCallStrike/Premium |
| `pmcc` | longCallStrike, longCallPremium, longCallDte, shortCallStrike, shortCallPremium, optional longCallImpliedVolatility |
| `roll` | optionType (put/call), oldStrike, newStrike, closeCost, newPremium, originalPremium, optional stockCostBasis (covered call) |

Every strategy also needs `underlyingPrice`, `dte`, and `impliedVolatility` (percent). `riskFreeRate` (percent, default 0) and `contracts` (default 1) are optional. Premiums are per share, and dollar outputs are multiplied by 100 × contracts.

#### Batch example

```json
{ "underlyingPrice": 100, "dte": 30, "impliedVolatility": 30,
  "calculations": [
    { "strategy": "cash_secured_put", "putStrike": 95, "putPremium": 1.5 },
    { "strategy": "iron_condor", "longPutStrike": 85, "longPutPremium": 0.5, "shortPutStrike": 90, "shortPutPremium": 1.2,
      "shortCallStrike": 110, "shortCallPremium": 1.1, "longCallStrike": 115, "longCallPremium": 0.4 } ] }
```

### Output (dataset, one row per calculation)

`maxProfit`, `maxLoss` (null when the value is unlimited, with `maxProfitUnlimited`/`maxLossUnlimited` flags), `breakevens`, `netPremiumPerShare` (+credit / −debit), `capitalRequired`, `returnOnCapitalPct`, `annualizedReturnPct` (simple, ROC × 365 / DTE), `probabilityOfProfitPct`, strategy-specific extras (for example `probabilityAssignedPct`, `wheelAdjustedCostBasis`, `setupValid` for PMCC, `rollType`), `warnings`, and `disclaimer`. Invalid inputs produce **no dataset row**: their errors appear in the run log, the status message, and the key-value store records `OUTPUT` and `ERRORS`.

### Methodology

- Probabilities: a risk-neutral lognormal model (Black-Scholes, N(d2)) using the IV and rate you supply, evaluated at expiration.
- CSP ROC = premium / strike (fully cash-secured). Spread and condor ROC = max profit / max loss.
- PMCC: the setup counts as valid when short strike > long strike + long-call debit. Max profit and breakeven are estimated at short-call expiry, with the remaining LEAPS value from Black-Scholes. Max loss = net debit.
- Roll: net credit/debit = new premium − buy-to-close cost. The new breakeven uses the total premium kept (original + roll net).

### Pricing

Pay-per-event: you are charged per successful result row in the dataset (one row per valid calculation) plus a tiny Actor start fee. Invalid inputs create no row and are not charged per result.

### Disclaimer

Educational, not advice. Not affiliated with any broker. Do your own research.

### Worked examples

All examples assume the underlying is at $100, 30 days to expiration, and 30% IV, with 1 contract. Dollar values are per contract.

#### Cash-secured put calculator example

Sell the 95 put for $1.50: `{"strategy":"cash_secured_put","underlyingPrice":100,"dte":30,"impliedVolatility":30,"putStrike":95,"putPremium":1.5}`
→ max profit **$150**, max loss **$9,350**, breakeven **$93.50**, return on capital **1.58%** (**19.21% annualized**), probability of profit **≈77%**.

#### Iron condor calculator example

Buy the 85 put / sell the 90 put / sell the 110 call / buy the 115 call for a $1.40 net credit: max profit **$140**, max loss **$360**, breakevens **$88.60 / $111.40**, ROC **38.9%**, plus a probability of profit and a probability of max profit.

#### Poor man's covered call (PMCC) example

LEAPS 80 call (365 DTE) bought for $23, with the 30-DTE 110 call sold for $1.50: net debit $21.50 = max loss **$2,150**. The setup is **valid** because 110 > 80 + 23. You also get the max profit and breakeven estimated at short-call expiry (Black-Scholes), plus the LEAPS extrinsic value. If you sell the 102 call instead, the result shows `setupValid: false` with a warning.

#### Options roll calculator example

Roll a short 95 put (originally sold for $1.50) down and out to a 90 put at 45 DTE: buy to close at $3.00, sell the new put for $3.50 → **$0.50 net credit**, total premium collected $2.00, new breakeven **$88.00**, ROC 2.22% on new collateral.

### Use with AI agents / MCP

The Actor is agent-ready. The input schema documents every field with an example, and each output is a structured JSON row.

- **Apify MCP server:** connect your MCP client (Claude Desktop, Cursor, VS Code, etc.) to `https://mcp.apify.com` with your Apify token. Add this Actor as a tool, for example with `https://mcp.apify.com?tools=xprm-llc/options-strategy-calculator`, or have the agent search for it with `add-actor`.
- **Call by name:** `xprm-llc/options-strategy-calculator`, via the API (`POST https://api.apify.com/v2/acts/xprm-llc~options-strategy-calculator/run-sync-get-dataset-items`), the Apify SDK, or MCP.
- **JSON input example** (batch):

```json
{ "underlyingPrice": 100, "dte": 30, "impliedVolatility": 30, "riskFreeRate": 4,
  "calculations": [
    { "strategy": "cash_secured_put", "putStrike": 95, "putPremium": 1.5 },
    { "strategy": "iron_condor", "longPutStrike": 85, "longPutPremium": 0.5, "shortPutStrike": 90, "shortPutPremium": 1.2,
      "shortCallStrike": 110, "shortCallPremium": 1.1, "longCallStrike": 115, "longCallPremium": 0.4 },
    { "strategy": "roll", "optionType": "put", "oldStrike": 95, "newStrike": 90, "closeCost": 3, "newPremium": 3.5, "originalPremium": 1.5, "dte": 45 } ] }
```

Each valid calculation returns one dataset row. Agents should read `maxProfit`, `maxLoss`, `breakevens`, `probabilityOfProfitPct`, and `warnings`.

### FAQ

**Does it fetch live option prices?** No. You supply every price. It's a pure options profit calculator with no data feed and no broker connection.
**How is probability of profit calculated?** With a Black-Scholes lognormal model at expiration, using your implied volatility and risk-free rate (N(d2) between the breakevens).
**How is ROC calculated?** CSP: premium / strike. Covered call: max profit if called away / wheel-adjusted cost basis. Spreads and iron condors: max profit / max loss. Annualized = ROC × 365 / DTE (simple, not compounded).
**What does the wheel cost basis mean?** Put earlier CSP and covered-call premiums in `priorPremiumsCollected`, and the Actor lowers your effective cost basis and breakeven.
**How do I check a PMCC?** The setup is flagged valid only when the short strike is above the long strike plus the LEAPS debit, so an assignment can't lock in a loss.
**What am I charged for?** Each successful result row, plus a tiny start fee. Invalid inputs produce no row; their errors go to the run log, the status message, and the `OUTPUT`/`ERRORS` records.
**Is this financial advice?** No. It's educational, not advice.

# Actor input Schema

## `strategy` (type: `string`):

Which strategy to calculate. One of: cash_secured_put, covered_call, bull_call_spread, bear_call_spread, bull_put_spread, bear_put_spread, iron_condor, pmcc, roll.

## `underlyingPrice` (type: `number`):

Current price of the underlying stock/ETF, which you supply (no quotes are fetched). Required for all strategies.

## `dte` (type: `number`):

Calendar days to expiration of the short leg (new expiry for rolls; short call for PMCC). Required.

## `impliedVolatility` (type: `number`):

Annualized implied volatility in PERCENT (30 = 30%), used for probability of profit/ITM. Required.

## `riskFreeRate` (type: `number`):

Optional annual risk-free rate in percent (e.g. 4 = 4%). Default 0.

## `contracts` (type: `integer`):

Number of contracts; dollar outputs = per-share values x 100 x contracts. Default 1.

## `label` (type: `string`):

Optional free-text tag echoed in the output row, e.g. ticker and expiry.

## `putStrike` (type: `number`):

cash_secured_put: strike of the short put.

## `putPremium` (type: `number`):

cash_secured_put: premium received per share (must be < strike).

## `stockCostBasis` (type: `number`):

covered_call / roll (call): price paid per share for the stock.

## `callStrike` (type: `number`):

covered_call: strike of the short call.

## `callPremium` (type: `number`):

covered_call: premium received per share.

## `priorPremiumsCollected` (type: `number`):

covered_call (wheel): premiums already collected per share on this position; lowers cost basis.

## `shortStrike` (type: `number`):

Vertical spreads: strike of the option you SELL.

## `shortPremium` (type: `number`):

Vertical spreads: premium per share of the sold option.

## `longStrike` (type: `number`):

Vertical spreads: strike of the option you BUY.

## `longPremium` (type: `number`):

Vertical spreads: premium per share of the bought option.

## `longPutStrike` (type: `number`):

iron_condor: long (protective) put strike, lowest strike.

## `longPutPremium` (type: `number`):

iron_condor: premium paid per share for the long put.

## `shortPutStrike` (type: `number`):

iron_condor: short put strike.

## `shortPutPremium` (type: `number`):

iron_condor: premium received per share for the short put.

## `shortCallStrike` (type: `number`):

iron_condor / pmcc: short call strike.

## `shortCallPremium` (type: `number`):

iron_condor / pmcc: premium received per share for the short call.

## `longCallStrike` (type: `number`):

iron_condor: long call strike (highest). pmcc: LEAPS strike (deep ITM, e.g. 80).

## `longCallPremium` (type: `number`):

iron_condor: premium paid for long call. pmcc: LEAPS price paid per share (e.g. 23).

## `longCallDte` (type: `number`):

pmcc: days to LEAPS expiration; must be greater than dte.

## `longCallImpliedVolatility` (type: `number`):

pmcc: optional IV (percent) of the LEAPS; defaults to impliedVolatility.

## `optionType` (type: `string`):

roll: type of the short option being rolled, put or call.

## `closeCost` (type: `number`):

roll: buy-to-close cost per share of the current option.

## `newPremium` (type: `number`):

roll: premium per share received for the new option.

## `oldStrike` (type: `number`):

roll: strike of the option being closed.

## `newStrike` (type: `number`):

roll: strike of the new option.

## `originalPremium` (type: `number`):

roll: premium originally received per share for the option being closed.

## `calculations` (type: `array`):

Optional batch: array of up to 100 objects with the same fields (each with its own 'strategy'). Top-level fields are defaults. Leave empty for a single calculation. One charged result row per valid calculation.

## Actor input object example

```json
{
  "strategy": "cash_secured_put",
  "underlyingPrice": 100,
  "dte": 30,
  "impliedVolatility": 30,
  "riskFreeRate": 4,
  "contracts": 1,
  "label": "SPY Nov CSP",
  "putStrike": 95,
  "putPremium": 1.5,
  "stockCostBasis": 100,
  "callStrike": 105,
  "callPremium": 1.2,
  "priorPremiumsCollected": 0,
  "shortStrike": 105,
  "shortPremium": 2.5,
  "longStrike": 110,
  "longPremium": 1,
  "longPutStrike": 85,
  "longPutPremium": 0.5,
  "shortPutStrike": 90,
  "shortPutPremium": 1.2,
  "shortCallStrike": 110,
  "shortCallPremium": 1.1,
  "longCallStrike": 115,
  "longCallPremium": 0.4,
  "longCallDte": 365,
  "longCallImpliedVolatility": 28,
  "optionType": "put",
  "closeCost": 3,
  "newPremium": 3.5,
  "oldStrike": 95,
  "newStrike": 90,
  "originalPremium": 1.5,
  "calculations": [
    {
      "strategy": "cash_secured_put",
      "putStrike": 95,
      "putPremium": 1.5
    },
    {
      "strategy": "bull_put_spread",
      "shortStrike": 95,
      "shortPremium": 2,
      "longStrike": 90,
      "longPremium": 0.8
    }
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

Calculation results in the default dataset (overview view).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "strategy": "cash_secured_put",
    "underlyingPrice": 100,
    "dte": 30,
    "impliedVolatility": 30,
    "riskFreeRate": 4,
    "contracts": 1,
    "label": "SPY Nov CSP",
    "putStrike": 95,
    "putPremium": 1.5,
    "stockCostBasis": 100,
    "callStrike": 105,
    "callPremium": 1.2,
    "priorPremiumsCollected": 0,
    "shortStrike": 105,
    "shortPremium": 2.5,
    "longStrike": 110,
    "longPremium": 1,
    "longPutStrike": 85,
    "longPutPremium": 0.5,
    "shortPutStrike": 90,
    "shortPutPremium": 1.2,
    "shortCallStrike": 110,
    "shortCallPremium": 1.1,
    "longCallStrike": 115,
    "longCallPremium": 0.4,
    "longCallDte": 365,
    "longCallImpliedVolatility": 28,
    "optionType": "put",
    "closeCost": 3,
    "newPremium": 3.5,
    "oldStrike": 95,
    "newStrike": 90,
    "originalPremium": 1.5,
    "calculations": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("xprm-llc/options-strategy-calculator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "strategy": "cash_secured_put",
    "underlyingPrice": 100,
    "dte": 30,
    "impliedVolatility": 30,
    "riskFreeRate": 4,
    "contracts": 1,
    "label": "SPY Nov CSP",
    "putStrike": 95,
    "putPremium": 1.5,
    "stockCostBasis": 100,
    "callStrike": 105,
    "callPremium": 1.2,
    "priorPremiumsCollected": 0,
    "shortStrike": 105,
    "shortPremium": 2.5,
    "longStrike": 110,
    "longPremium": 1,
    "longPutStrike": 85,
    "longPutPremium": 0.5,
    "shortPutStrike": 90,
    "shortPutPremium": 1.2,
    "shortCallStrike": 110,
    "shortCallPremium": 1.1,
    "longCallStrike": 115,
    "longCallPremium": 0.4,
    "longCallDte": 365,
    "longCallImpliedVolatility": 28,
    "optionType": "put",
    "closeCost": 3,
    "newPremium": 3.5,
    "oldStrike": 95,
    "newStrike": 90,
    "originalPremium": 1.5,
    "calculations": [],
}

# Run the Actor and wait for it to finish
run = client.actor("xprm-llc/options-strategy-calculator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "strategy": "cash_secured_put",
  "underlyingPrice": 100,
  "dte": 30,
  "impliedVolatility": 30,
  "riskFreeRate": 4,
  "contracts": 1,
  "label": "SPY Nov CSP",
  "putStrike": 95,
  "putPremium": 1.5,
  "stockCostBasis": 100,
  "callStrike": 105,
  "callPremium": 1.2,
  "priorPremiumsCollected": 0,
  "shortStrike": 105,
  "shortPremium": 2.5,
  "longStrike": 110,
  "longPremium": 1,
  "longPutStrike": 85,
  "longPutPremium": 0.5,
  "shortPutStrike": 90,
  "shortPutPremium": 1.2,
  "shortCallStrike": 110,
  "shortCallPremium": 1.1,
  "longCallStrike": 115,
  "longCallPremium": 0.4,
  "longCallDte": 365,
  "longCallImpliedVolatility": 28,
  "optionType": "put",
  "closeCost": 3,
  "newPremium": 3.5,
  "oldStrike": 95,
  "newStrike": 90,
  "originalPremium": 1.5,
  "calculations": []
}' |
apify call xprm-llc/options-strategy-calculator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xprm-llc/options-strategy-calculator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/IzNPfFGBBQQmcBrN5/builds/YbCJDfUDd3h5Wbszq/openapi.json
