Hi there · Runbook · SPX strategy
SPX strategy
How the live SPX rail is configured, armed and supervised.
SPX Options Operations
How the SPX credit-spread system works today: the single live rail, the server-side premium stop safety net, the daily operating workflow, and the roadmap. ← Back to Runbook home
What is running, and in what mode▸
SPX now runs on ONE rail. August 2026 consolidated four competing scripts down to the single engine that survived a real-quote bake-off.
- VIDYA/RSI Harvester v1.2 (spx_vidya_rsi rail) — LIVE paper, the only armed SPX rail. A VIDYA trend gate (an adaptive moving average with ATR-200 bands ×2.5) picks the side: trend up → sell put spreads only, trend down → call spreads only. Inside that trend, RSI-4 crossing up through 30 (or down through 70) is the entry. Sells a 0DTE SPXW spread 10 points OTM, 25 points wide, and holds it to the 3:00p CT settlement — there is no profit target on purpose. Up to 3 spreads open at once; entries only between 8:45a and 12:45p CT. Chart: SP:SPX, 5-minute.
- Retired 2026-08-14 (allocation 0.00, code and journals kept): v3 Premium Harvester, RSI Snapback, RSI/VWAP, Crash Harvester. Their old chart alerts are paused — if one ever fires again the server rejects it at the entry gate.
- On standby (allocation still 0.02 but no old chart alert has fired since 2026-07-30): spx_0dte_1min, spx_0dte_pt50, spx_0dte_15min, spx_0dte_15min_eod, spx_1dte_eod, rsi_rsi_spx. Nothing reaches them until an alert is re-created.
Why hold to settlement instead of taking profits? The study that produced this rail measured the real credit paid by the option chain (a year of actual OPRA quotes, 322 signals): average credit $5.40 against a $4.61 breakeven, ~77–79% win rate. Closing early gives back the part of the premium that decays in the last hour — the edge is the hold. The premium stop is what keeps the bad days finite.
The breakeven math that drives every decision▸
Credit-spread selling wins small and loses big. Our measured averages: wins of roughly $150–$190, losses of roughly $750–$1,600. At those numbers the system needs an 84–87% win rate just to break even.
That leads to the two operating rules:
- Tail size is THE lever. Shrinking the worst loss from $1,600 to $800 lowers the required win rate more than any entry tweak raises the actual one. This is why the server premium stop (below) exists.
- Only trade with the daily trend. The 176-trade study split +$5.7k (with-trend) vs −$14.6k (counter-trend). Every current script enforces this with a daily SMA20 gate.
What it is and how it works▸
A smoke alarm for every open SPX spread, running on the server (not on the chart):
- Every 10 minutes during market hours the server asks the broker what it would really cost to buy back each open spread.
- It compares that cost to the credit collected at entry.
- If the buyback cost reaches 2.5× the entry credit, the server closes the trade immediately at market — it cancels the resting profit-target order first, then buys the spread back, logs the loss, and journals the exit as SERVER_STOP_LOSS.
Worked example: collect $5.00 at entry → the stop fires if buyback reaches $12.50 → loss ≈ (12.50 − 5.00) × 100 = −$750, instead of drifting toward a −$1,000–$1,600 max-width loss.
Because it watches real quotes, the protection is identical no matter what chart timeframe the alert script runs on. Chart stops only confirm on bar close — slow on a 5-minute chart; the server doesn't wait.
It protects every SPX credit-spread rail that has an open position — including the live spx_vidya_rsi rail, which was added to the protected list on 2026-08-16. On that rail the stop matters more than anywhere else: the spread is held to settlement with no profit target, so the premium stop is the only thing that can close a losing day early.
Tune, loosen, or disable the premium stop▸
The config lives in /home/victor/spx-server/allocations.json, block spread_premium_stop:
- stop_multiple — currently 2.5. Raise to 3.0 for fewer (but larger) stop-outs; the agreed sane range is 2.5–3.0.
- stop_multiple_overrides — per-strategy exceptions, e.g. {"spx_0dte_pt50": 3.0}.
- enabled — set false to turn the whole thing off (not recommended).
After editing, restart the SPX brain (after hours). SSH in first — prompt must say victor@spx-server:
kill -9 $(pgrep -f "spx-server/server.py" | head -1)
Wait ~15 seconds, then confirm it's healthy:
curl -s http://127.0.0.1:5005/health | head -c 200; echo; grep "Spread premium stop" /var/log/spx-server.log | tail -1
The log line shows the settings the server actually loaded — check the multiple matches what you set.
Verify a premium-stop fire (do this after the first one)▸
When the stop fires you'll want proof everything downstream recorded it correctly:
- Server log:
grep "PREMIUM_STOP_FIRED" /var/log/spx-server.log | tail -5 - Journal: the trade's exit row should read SERVER_STOP_LOSS with reason server_premium_stop:
grep "server_premium_stop" /home/victor/spx-server/journal/trades_journal_2026.csv | tail -3 - Panel: after 5:30p CT (the daily ledger rebuild), the trade should appear on the SPX pages as a closed loss of roughly (multiple − 1) × credit × 100. If it still shows open the next day, something is wrong — investigate.
Chart setup and what the table tells you▸
- Chart: SP:SPX, 5-minute. Indicator: "SPX VIDYA/RSI Harvester".
- ONE chart alert on that script, type "Any alert() function call", pointed at the webhook URL. After changing any input you must delete and re-create the alert — the chart platform freezes an alert's settings at the moment it was created, and it also stops every alert on a script the moment the script is edited.
- Inputs that must be right before arming: Webhook Secret filled in, Enable Webhook Alerts ticked, entry window 8:45a–12:45p CT, Max concurrent spreads 3.
- The status table shows live context (trend side, RSI-4, slot state, entries taken) plus a rough running P&L. Treat the table's P&L as an estimate — it prices spreads from a flat-IV model, while the server books what the chain actually pays. The server's paper fills use the natural price (the conservative side of the spread), so live numbers run below the chart's.
- Normal days with no signal exist. The gate needs a VIDYA trend and an RSI-4 cross inside the window; the study averaged roughly one entry per day, and 3 concurrent happened once in a year.
JSON label verification (before arming webhooks)▸
The script has a debug switch: indicator Settings → Inputs → Webhook group → "Show JSON labels on chart".
When ON, every signal bar prints the exact JSON payload the webhook would send — the same string, byte for byte. Use it to eyeball, before going live:
- Option symbols — legs read like SPXW 260730P00007350: right root, today's date, P for put spreads / C for call spreads, strike padded to 8 digits.
- Strikes make sense — short strike beyond the expected move, long strike exactly one width farther out.
- Signal types — entries say ENTRY_BULL/ENTRY_BEAR; the settlement exit says EXIT_EOD (fired on the 2:55p CT bar). This rail sends no profit-target exit — it has no profit target.
- position_id is consistent between a trade's entry and its exits.
The labels work while webhooks are OFF — that's the point. Verify first, arm later. Turn the switch off afterward to keep the chart clean.
Phases: where we are▸
- Phase 1 — DONE (2026-07-30): server premium stop live on the SPX rails. Makes the worst-case loss timeframe-independent.
- Phase 2 — DONE (2026-08-08 → 08-14): four candidate scripts armed and paper-traded side by side, then priced against a year of real OPRA quotes. The VIDYA/RSI engine won; the other four were retired to allocation 0.00.
- Phase 3 — DONE (2026-08-14): spx_vidya_rsi given its own server rail, alert armed, first signals delivered. Widened to the 8:45a–12:45p window with up to 3 concurrent spreads the same evening; the minimum-credit entry gate was relaxed from 15% to 10% of width ($2.50 on a 25-wide) after the real-quote study showed the cheaper credits were the highest-win-rate subset.
- Phase 4 — NOW: build the live paper record on the one rail. Watch that entries appear in the window, that the settlement exit lands, and that the premium stop behaves on the first bad day.
- Phase 5 — ON FUNDING (~Sep 2026): switch off paper mode, drop the paper account-size override, restore the real spend cap, and add a limit-at-mid reprice ladder for entries (paper currently books at the natural price, which is deliberately pessimistic).