Fortress Script Reference

Usage guide for all 12 Python tools. Each section shows common command patterns, key flags, and a live preview of real output. All scripts run from ~/fortress/scripts/ using python3.

Flags auto-updated weekly — last refresh: 10 May 2026

🏰
Fortress Optimizer
fortress_v26.py β€” ~5100 lines
Three-archetype optimizer (PIONEER / DIAMOND / VAULT). Selects LC+SP+HP+SC strikes for minimum capital, max leverage.
HTML + JSON IBKR or CSV
Live IBKR β€” single ticker
python3 fortress_v26.py --live --tickers NVDA --contracts 10
Live β€” multiple tickers
python3 fortress_v26.py --live --tickers MSTR COIN BMNR --contracts MSTR:5 COIN:10 BMNR:20
From CSV (no IBKR needed)
python3 fortress_v26.py ~/fortress/runs/CSVs/NVDA_20260401.csv --contracts 10
Short-term mode + risk cap
python3 fortress_v26.py --live --tickers XLE --short-term --risk XLE:50k
Sigma analysis + parallel
python3 fortress_v26.py --live --tickers QQQ SPY --sigma --parallel 4
FlagDescriptionDefault
csv_filesOne or more fortress export CSVs. Required unless --live is used.
--contractsContracts per ticker. Single number (e.g. --contracts 5) or
--riskMax loss budget per ticker in dollars.
--fight-otmFIGHT mode CC OTM%%%% from stressed stock (default: 0.01 = 1%%%%).
--run-labelCustom label for output folder. Routes outputs to runs/{label}/
--dd-levelMax drawdown level for survival curve (default: 40, max: 90).40
--drawdown-pctDrawdown %% for stress testing (default: IV-scaled)
--min-income-dteMinimum DTE for income calls (default: 7)7
--deltaSC delta cap for income calls (e.g. --delta 0.20).
--sigmaShow CC sigma analysis in dashboard (e.g. --sigma 1.0).
--tickersFilter to specific tickers (e.g. --tickers TSLA NVDA)
--no-dashboardSkip HTML dashboard generation
--no-jsonSkip JSON results file
--allWhen --contracts has per-ticker overrides, include ALL tickers
--landscapeRun landscape correlation analysis per ticker (verifies
--short-termShort-term income mode: uses all LEAPS chains (not just far),
--liveLive mode: connect to IBKR TWS, fetch chains in real-time,
--hostIBKR TWS host (default: {LIVE_HOST})LIVE_HOST
--portIBKR port (default: auto-detect. Tries 4001 Gateway Live,LIVE_PORT
--client-idIBKR client ID (default: {LIVE_CLIENT_ID})LIVE_CLIENT_ID
--parallelNumber of parallel IBKR connections for live mode4
--income-dteDTE range for income calls in live mode (default: 5 46).
--leaps-dteDTE range for LEAPS in live mode (default: 180 9999,
--publishPublish dashboard to Cloudflare Pages via wrangler.
--notifySend push notification via ntfy.sh when dashboard is ready.
--telemetryv20.10: Always on (kept for backward compat).True
--no-auditSkip auto-generating audit HTML after scan.False
runs/fortress/{TICKER}/latest.html runs/fortress/{TICKER}/{TIMESTAMP}.html runs/fortress/{TICKER}/audit_{TIMESTAMP}.html runs/CSVs/{TICKER}_{TIMESTAMP}.csv ← live mode only
runs/fortress/FLNC/latest.html
β†— open full
πŸ—
LEAPS Builder
leap_builder.py β€” ~2120 lines
Builds optimal LC+SP+HP fortress structures for new tickers. Bucket A (deep ITM) vs Bucket B (OTM leverage), configurable split.
HTML + JSON Audit IBKR
Single ticker, default split (50/50 ITM/OTM)
python3 leap_builder.py --tickers NVDA:250k
Multiple tickers, explicit mode
python3 leap_builder.py --tickers MSTR:100k:itm COIN:80k:otm
Custom budget split (70% ITM, 30% OTM)
python3 leap_builder.py --tickers GOOG:200k:both --budget-split 70/30
From CSV (skip IBKR)
python3 leap_builder.py --tickers XLE:150k --csv ~/fortress/runs/CSVs/XLE_chain.csv
--tickers TICKER:BUDGET[:MODE] MODE options: itm β†’ Bucket A only (deep ITM, income-focused) otm β†’ Bucket B only (OTM leverage play) both β†’ Split between A and B (default)
FlagDescriptionDefault
--tickersOne or more positions. SIZE = 30k/100k/1m (budget) or 20c (contracts).
--csvUse a saved chain CSV (offline mode, skip IBKR).
--cc-overlayScan CC overlay (short-dated calls above safe strike)
--parallelParallel workers (live mode only, hard cap {PARALLEL_MAX_WORKERS};PARALLEL_MAX_WORKERS
--min-dteMinimum DTE for LEAPS chain discovery (default: {MIN_DTE_DEFAULT})MIN_DTE_DEFAULT
--max-chainsNumber of furthest-out chains to scan (default: {MAX_CHAINS})MAX_CHAINS
--htmlOverride HTML output path (default: routed via OutputManager)
--auditOverride audit JSON output path (default: routed via OutputManager)
--hostIBKR host (default: {DEFAULT_HOST})DEFAULT_HOST
--portIBKR port (default: 0 = auto-detectDEFAULT_PORT
--client-idIBKR client ID (default: {DEFAULT_CLIENT_ID})DEFAULT_CLIENT_ID
--breakoutBreakout mode: score by weighted P&L across sigma-multiples of the
--breakout-targetOverride sigma-scaled scoring with a SINGLE fixed-pct target
--stop-loss-pctScore by reward / MTM-loss-at-stop instead of reward / structural-ML.
--yoloYOLO mode: widened OTM ranges (LC 95-300%% of stock, SP 30-130%%) and
--yolo-capOverride LC max strike multiplier in YOLO mode (default:YOLO_LC_MAX_STRIKE_PCT_DEFAU
--anchorAnchor all comparisons to a specific chain. Without LABEL: use
--allRun NORMAL + BREAKOUT + YOLO in one go and generate a single combined
runs/leaps/{TICKER}/latest.html runs/leaps/{TICKER}/{TIMESTAMP}.html runs/leaps/{TICKER}/audit_{TIMESTAMP}.json
runs/leaps/FLNC/latest.html
β†— open full
πŸ”
Covered Call Scanner
cc_scanner.py β€” ~3070 lines
Sigma-band scoring for CC strikes above safe strike. IER (Income Efficiency Ratio) ranking. Single ticker or batch portfolio scan.
HTML per ticker + portfolio IBKR
Single ticker with safe strike
python3 cc_scanner.py NVDA 480 --contracts 10
Batch portfolio scan from CSV
python3 cc_scanner.py --csv positions.csv --parallel 4
Reload previous scan (no IBKR)
python3 cc_scanner.py --from-scan ~/fortress/runs/CSVs/cc_scan_data.csv
Drawdown mode (tighter delta cap 0.25)
python3 cc_scanner.py GLD 165 --contracts 20 --drawdown-mode
FlagDescriptionDefault
tickerStock ticker symbol (single-ticker mode)
safe_strikeSafe Strike of the fortress (single-ticker mode)
--csvPath to CSV position file for batch/portfolio scan (requires IBKR)
--from-scanPath to previously exported scan CSV (no IBKR needed, dashboards only)
--output-dirOutput directory for all files (default: ./outputs)./outputs
--contractsNumber of contracts (single-ticker mode, default: 10)10
--max-deltaMaximum delta filter (default: {MAX_DELTA})MAX_DELTA
--max-dteMaximum DTE to scan (default: from CSV per-ticker, or {MAX_DTE} in single-ticker mode)
--min-dteMinimum DTE to scan (default: from CSV per-ticker, or {MIN_DTE} in single-ticker mode)
--hostIBKR TWS host (default: {DEFAULT_HOST})DEFAULT_HOST
--portIBKR port (default: auto-detect. Tries 4001, 4002, 7496, 7497)DEFAULT_PORT
--client-idIBKR client ID (default: {DEFAULT_CLIENT_ID})DEFAULT_CLIENT_ID
--drawdown-modeEnable drawdown mode (tighter DTE preference)
--no-browserDo not auto-open dashboards in browser
--outputOutput HTML filepath (single-ticker mode only)
--parallelNumber of parallel IBKR connections for batch mode (default: 4).4
--tickersFilter --csv to only these tickers (e.g. --tickers MSFT NVDA TSLA)
--skip-cc-timingSkip the automatic cc_timing.py refresh at start of run.
runs/cc_scanner/{TICKER}/latest.html ← per ticker runs/cc_scanner/cc_scan_PORTFOLIO.html ← master view runs/CSVs/cc_scan_data.csv ← reusable scan data
deploy/cc_scanner/TSLA_20260508_2357.html
β†— open full
πŸ”„
Roll Calls Analyzer
roll_calls.py β€” ~3550 lines
Scans existing short calls for roll-up (threatened) and roll-down (decayed) opportunities. Sigma-only thresholds, no DTE gate.
HTML dashboard IBKR
Full portfolio scan (roll-up + roll-down)
python3 roll_calls.py --roll-up --roll-down
Specific tickers, defensive roll-up only
python3 roll_calls.py --tickers NVDA COIN --roll-up
Roll-down with custom sigma floor
python3 roll_calls.py --roll-down --min-sigma 0.70 --top-n 5
Ticker with contracts + safe strike override
python3 roll_calls.py --tickers MSTR:5:350 --roll-up --roll-down
With safe strike CSV + show debit rolls
python3 roll_calls.py --csv ss_overrides.csv --roll-up --show-debits
FlagDescriptionDefault
--hostTWS host (default: {DEFAULT_HOST})DEFAULT_HOST
--portTWS port (default: {DEFAULT_PORT})DEFAULT_PORT
--client-idClient ID (default: {DEFAULT_CLIENT_ID})DEFAULT_CLIENT_ID
--max-dteMax DTE for current positions to scan (default: {MAX_CURRENT_DTE})MAX_CURRENT_DTE
--sigma-rollSigma threshold for ROLL (default: {SIGMA_ROLL})SIGMA_ROLL
--sigma-threatenedSigma threshold for THREATENED (default: {SIGMA_THREATENED})SIGMA_THREATENED
--sigma-watchSigma threshold for WATCH (default: {SIGMA_WATCH})SIGMA_WATCH
--delta-fallbackDelta fallback when IV unavailable (default: {DELTA_FALLBACK})DELTA_FALLBACK
--max-roll-dteMax DTE for roll candidates (default: {MAX_ROLL_DTE})MAX_ROLL_DTE
--target-deltaTarget max delta for rolls (default: {TARGET_DELTA})TARGET_DELTA
--top-nTop N candidates per position (default: {TOP_N})TOP_N
--accountIBKR account ID (e.g., U1234567). If omitted, uses default account.
--tickersTicker filter with optional contract count and safe strike.
--roll-upScan for roll-up candidates (defensive, move strike higher).
--roll-downScan SAFE positions (sigma >= sigma_watch, delta <= 0.15)
--forceForce roll analysis for --tickers positions
--show-debitsShow best debit rolls when credits are scarce (cheapest path to safety)
--proactiveFetch proactive roll candidates for WATCH/THREATENED positions
--min-sigmaMinimum sigma floor for roll-down targets (default: {ROLLDOWN_MIN_SIGMA})ROLLDOWN_MIN_SIGMA
--jsonExport all roll data to JSON at this path (e.g., --json rolls.json).
--htmlWrite HTML dashboard to this path (e.g., --html rolls.html).
--csvCSV with safe strikes per ticker (cols: TICKER, SS).
--parallelNumber of parallel IBKR connections for roll analysis4
--debugPrint detailed chain diagnostics for roll expiration discovery
runs/rolls/{TICKER}/latest.html runs/rolls/PORTFOLIO/latest.html ← full scan
runs/rolls/PORTFOLIO/latest.html
β†— open full
βœ…
CC Check
cc_check.py β€” ~390 lines
Reads safe_strike_list.csv, scans all IBKR accounts, and reports missing or partial covered call coverage.
HTML dashboard IBKR
Default scan (all accounts, safe_strike_list.csv)
python3 cc_check.py
Custom CSV
python3 cc_check.py --csv my_list.csv
Specific account only
python3 cc_check.py --account U1234567
Specific port
python3 cc_check.py --port 4001
runs/cc_check/PORTFOLIO/latest.html deploy/cc_check/PORTFOLIO.html ← CF staged
deploy/cc_check/PORTFOLIO.html
β†— open full
🧭
Fortress Rebuild (Lifecycle Manager)
fortress_rebuild.py β€” ~3100 lines
Read-only lifecycle analyzer. Scans every fortress position across all IBKR accounts and recommends one action per fortress: SKIP, WAIT, ROLL, UNCAP, or REBUILD. Surfaces ride-to-expiry math (stock flat vs stock at CC strike), proactive roll candidates, and stranded-WAIT escalations. Routes all IBKR fetches through module_ibkr_fetch for identical reliability and logging (FROZEN→DELAYED→SNAP cascade, OI backfill, deep-ITM historical fallback).
HTML dashboard IBKR
Scan every fortress across every account
python3 fortress_rebuild.py
Bind to active_fortresses.csv (authoritative Entry / Safe Strike / Net Debit)
python3 fortress_rebuild.py --csv
Filter to specific tickers
python3 fortress_rebuild.py --tickers COIN,MSTR,IREN
Horizon cutoff β€” only fortresses with HP expiring by date; CC scan window tightens to match
python3 fortress_rebuild.py --expiry 2026-09-30
Single account
python3 fortress_rebuild.py --account U18827291
Fast mode β€” skip proactive roll fetches (useful for triage on slow IBKR)
python3 fortress_rebuild.py --no-rolls
Re-render from cached scan (no IBKR) β€” iterate on decision logic offline
python3 fortress_rebuild.py --cached
SKIP — structurally safe, no action needed.
WAIT — margin OK but borderline; monitor. Borderline variants show theta/trip-wire narrative.
WAIT (MARGINAL) — sigma is thin; roll candidates fetched proactively to find an escape.
ROLL CC — concrete roll candidate identified with credit, new sigma, and survival.
UNCAP — close the short call (strike capped, no forward roll viable).
REBUILD — structural damage; suggests going to leap_builder or fortress_repair.
Every decision shows the "do nothing" baseline as explicit P/L:
CLOSE P/L — close fortress now at market mids.
STOCK FLAT — hold through CC expiry, stock unchanged. CC extrinsic decays to zero.
STOCK @ $strike — hold through CC expiry, stock rallies to cap. Adds fortress gain using full synthetic delta (LC long + SP short − HP long).
FlagDescriptionDefault
--hostTWS hostDEFAULT_HOST
--portTWS port (default 7496)DEFAULT_PORT
--client-idIBKR clientIdDEFAULT_CLIENT_ID
--accountSingle account to scan (default: all managed)
--tickersTicker filter. Space-separated or comma-separated
--expiryHorizon cutoff date. (1) Hedge-put (HP): only show fortresses
--csvUse active_fortresses.csv as structural authority (ticker β†’
--cachedReuse cached scan data (skip IBKR)
--no-rollsSkip roll-chain fetches (faster)
--get-cc-timingRun cc_timing.py first to refresh the weekly-gate
--cc-suggestAppend a section at the bottom of the dashboard
--cc-suggest-max-dteMax DTE for CC suggestionsCC_SUGGEST_MAX_DTE_DEFAULT
--cc-suggest-scopeWhich fortresses to include: BOTH (default),CC_SUGGEST_SCOPE_BOTH
--cc-suggest-max-rowsOptional explicit cap on candidate rows per expiry.
--jsonAlso write raw JSON to this path
--htmlAlso write HTML to this explicit path (OutputManager always runs)
runs/rebuild/{TICKER_LIST}/latest.html deploy/rebuild/{TICKER_LIST}.html ← CF staged
runs/rebuild/GOOG_UAMY/latest.html
β†— open full
⚑
FIGHT Income Recovery
fortress_fight.py β€” ~2320 lines
Aggressive drawdown recovery via near-ATM short-dated calls. P&L curves at 8 price points, gap-up scenarios, income target tracking.
HTML + JSON IBKR
From fortress_results.json (most common)
python3 fortress_fight.py --from-results ~/fortress/runs/fortress/NVDA/fortress_results.json
Manual ticker + position detail
python3 fortress_fight.py --ticker NVDA:10:480:20260620 --fight-dte 7 --fight-otm 0.01
Multiple tickers from results
python3 fortress_fight.py --from-results fortress_results.json --tickers NVDA GLD COIN
Custom gap-up + income targets
python3 fortress_fight.py --ticker MSTR:5:350:20270117 --gap-pct 0.15 --targets 0.25 0.50 0.75 1.00
FlagDescriptionDefault
csv_fileChain data CSV (skips live chain fetch, still reads IBKR portfolio)
--tickersTicker symbols. Space-separated or comma-separated
--csvPath to active_fortresses.csv (ticker β†’ contracts,
--legsOptional leg detail (e.g. GLD:HP:410:20260630:7.214). Repeatable.
--from-resultsRead positions from fortress_results.json
--hostIBKR TWS host (default: 127.0.0.1)127.0.0.1
--portIBKR port (default: auto-detect. Tries 4001, 4002, 7496, 7497)0
--client-idIBKR API client ID (default: 99).99
--accountIBKR account ID (e.g. U1234567).
--parallelParallel IBKR connections (default: 4)4
--fight-otmOTM%% for FIGHT CCs (default: {FIGHT_OTM_DEFAULT} = 1%%)FIGHT_OTM_DEFAULT
--fight-dteTarget DTE for FIGHT CCs (default: {FIGHT_DTE_DEFAULT})FIGHT_DTE_DEFAULT
--expiryHP (hedge put) expiry date. Accepts: 20260630, 30-Jun-2026,
--targetsIncome recovery targets as fractions (default: 0.35 0.70)TARGETS_DEFAULT
--gap-pctGap-up scenario for risk calc (default: {GAP_PCT_DEFAULT} = 10%%)GAP_PCT_DEFAULT
--htmlHTML output path (default: fight_TICKER_TIMESTAMP.html)
--no-htmlSuppress HTML output entirely
--jsonJSON output path
--publishStage and deploy HTML to Cloudflare Pages directory
--notifyPush notification via ntfy.sh when done
--forceShow roll decisions for ALL current CCs regardless of sigma
--roiOverride annual ROI on ML for normal income ref
--ndOriginal entry ND per share (immutable, from trade creation).
runs/fight/{TICKER}/latest.html runs/fight/{TICKER}/{TIMESTAMP}.html
runs/fight/IREN/latest.html
β†— open full
πŸ”§
Fortress Repair Analyzer
fortress_repair.py β€” ~2800 lines
Analyzes SP roll-down paths to lower the safe strike. Recommends HP repairs with payback analysis. Post-repair CC sustainability included.
HTML dashboard IBKR
Analyze specific tickers
python3 fortress_repair.py NVDA MSTR COIN
All fortress positions in portfolio
python3 fortress_repair.py --all
Filter by HP expiry, limit payback period
python3 fortress_repair.py --all --expiry 2026-06 --max-payback 0.5
With CC income override
python3 fortress_repair.py XLE --cc-income 0.45 --hp-min-dte 45 --hp-max-dte 90
FlagDescriptionDefault
tickersTicker(s) to analyze (e.g. IREN IWM TSLA)
--allAnalyze all fortress positions in portfolio
--expiryFilter to positions with HP expiring by this date (YYYY-MM or YYYYMMDD).
--hp-min-dteMin DTE for HP candidates (default: {HP_MIN_DTE}).HP_MIN_DTE
--hp-max-dteMax DTE for HP candidates (default: {HP_MAX_DTE})HP_MAX_DTE
--gap-multMax ratio of new_gap vs current gap (default: 2.0).2.0
--price-multiplierAdd pick_score ROI component at Nx current stock price.0
--max-paybackMax payback period in years for repair candidates (default: 1.0).1.0
--cc-incomeMonthly CC income per share override (e.g., 4.00).0
--maint-roll-dteDTE threshold for healthy-fortress HP maintenance rollMAINT_ROLL_DTE
--maint-cost-capMax ratio of new HP annual cost vs CC annual income forMAINT_COST_CAP
--no-maintSkip the maintenance-roll pass on healthy fortresses.
--accountLimit scan to this account ID. Default scans ALL
--positionsCSV with actual position data (overrides IBKR avg_cost).
--jsonExport to JSON file
--htmlExport HTML dashboard
--csvCSV with safe strikes / ND / contracts / leg strikesDEFAULT
--ndNet Debit per share override (e.g., 16.0).0
runs/repair/{TICKER}/latest.html runs/repair/{TICKER}_{TICKER2}/latest.html ← multi-ticker
runs/repair/COPX/latest.html
β†— open full
βš™οΈ
Repair Trades Finder
repair_trades.py β€” ~3990 lines
Finds concrete 6-leg BAG repair trades (close 3 + open 3) with real IBKR prices. Exhaustive 1k-2k combo search, TIMS margin enrichment, P&L curves.
HTML + JSON Audit IBKR
Basic repair analysis
python3 repair_trades.py MSTR
Specify expiry + contracts
python3 repair_trades.py COIN --expiry 20270117 --contracts 5
With IBKR margin check + CC overlay
python3 repair_trades.py BMNR --margin --cc --gap-mult 3.0
Crypto miner: 3x price projection + FIGHT panel
python3 repair_trades.py MARA --price-multiplier 3 --fight --cc
Custom DTE range for target LEAPS
python3 repair_trades.py NVDA --min-target-dte 400 --max-target-dte 800
FlagDescriptionDefault
tickerTicker to analyze (e.g. MARA)
--expiryCurrent position expiry to match (YYYYMMDD or 18-sep-2026).
--contractsOverride contract count (e.g. 200 for 200 contracts = 20000 shares)0
--lcSelect fortress structure by LC strike (e.g. --lc 60).0
--htmlHTML output path (default: repair_<TICKER>_<timestamp>.html)
--auditAudit log JSON path (default: audit_<TICKER>_<timestamp>.json)
--gap-multMax gap multiplier vs current gap (default: {SA_GAP_MULT}x)SA_GAP_MULT
--marginRun IBKR whatIf margin checks on top candidates (requires write access)
--min-target-dteMinimum DTE for target LEAPS expiries (default: 365)365
--max-target-dteMaximum DTE for target LEAPS expiries (default: 1100)1100
--price-multiplierAdd P&L projection at Nx current price (e.g., 10 for 10x).0
--ccAdd CC income overlay to lens picks (scans DTE 5-50 call chains)
--fightAdd FIGHT income panel: near-ATM short-dated CCs for income
--ndOverride net debit per share (all-in cost basis).0
--no-rollSkip roll candidates entirely. Only restructure within current expiry.
--max-candidatesCap total candidates after merge (default 250000).250000
--pnlP&L curve only. Connects to IBKR, reads position,
--pnl-maxMax stock price for P&L curve (default: 5x current price)0
runs/repair_trades/{TICKER}/latest.html runs/repair_trades/{TICKER}/audit_{TIMESTAMP}.json
runs/repair_trades/MARA/latest.html
β†— open full
🧠
Stock Researcher
stock_researcher.py β€” ~3040 lines
4-pillar quantitative scoring: Fundamentals (40%) + Technicals (15%) + Fortress Fit (30%) + Valuation (15%). AI narrative via Claude API. Hard gates apply.
HTML report
Research single ticker
python3 stock_researcher.py NVDA
Batch research (multiple tickers)
python3 stock_researcher.py MSTR COIN BMNR RKLB HOOD AMD SOFI NVDA PLTR MU
Custom investment horizon
python3 stock_researcher.py GOOG --horizon "2-3 years"
No IBKR (yfinance IV only)
python3 stock_researcher.py MU AMD PLTR --no-ibkr
PillarWeightKey Metrics
Fundamentals40%Revenue growth, margins, FCF, debt
Fortress Fit30%IV, liquidity, options chain depth, trend alignment
Valuation15%P/E, P/S, EV/EBITDA vs peers
Technicals15%Momentum, moving averages, RSI
FlagDescriptionDefault
tickersStock tickers
--horizonInvestment horizon (default: '1-2 years1-2 years
--outputOutput HTML path
--api-keyAnthropic API key (or ANTHROPIC_API_KEY env)
--no-ibkrSkip IBKR, yfinance IV only
--jsonAlso dump raw data as JSON alongside HTML
runs/research/{TICKER}/latest.html runs/research/{TICKER1}_{TICKER2}/latest.html ← multi
runs/research/ARM_CIFR_MRVL/latest.html
β†— open full
πŸ“Š
Portfolio Dashboard
fortress_portfolio.py β€” ~1360 lines
Reads live IBKR positions, identifies all fortress structures, computes live metrics (SS, gap, income, survival). Snapshot of the full book.
HTML dashboard IBKR
Full portfolio snapshot
python3 fortress_portfolio.py --all
Specific tickers only
python3 fortress_portfolio.py NVDA MSTR COIN GLD
Filter by LEAPS expiry month
python3 fortress_portfolio.py --all --expiry 2027-01
With average cost override from CSV
python3 fortress_portfolio.py --all --positions ~/my_positions.csv
FlagDescriptionDefault
tickersTicker(s) to include (e.g. IREN IWM TSLA)
--allInclude all fortress positions in portfolio
--expiryFilter to positions with LEAPS expiring by this date (YYYY-MM or YYYYMMDD)
--accountAccount ID(s) to scan. Comma-separated or space-separated.
--positionsCSV with actual position data (overrides IBKR avg_cost).
--htmlOutput HTML file path
--jsonExport to JSON file
runs/fortress/PORTFOLIO/latest.html runs/fortress/PORTFOLIO/{TIMESTAMP}.html
runs/fortress/PORTFOLIO/latest.html
β†— open full
πŸ“€
Chain Exporter
fortress_export.py β€” ~1180 lines
Exports full option chains (LEAPS + Hedge + Income) with Greeks to CSV. Used to feed fortress_v26.py in offline mode. Parallel workers, FROZEN/DELAYED fallbacks.
CSV output only IBKR required
Export single ticker (all strikes)
python3 fortress_export.py NVDA
Export multiple tickers in parallel
python3 fortress_export.py MSTR COIN GLD XLE --parallel 4
Short-term mode (280-450d LEAPS)
python3 fortress_export.py NVDA --short-term
Custom DTE ranges for each chain type
python3 fortress_export.py SPY QQQ --leaps-dte 365 900 --hedge-dte 45 90 --income-dte 7 30
Then feed directly to optimizer
python3 fortress_v26.py ~/fortress/runs/CSVs/NVDA_20260407.csv --contracts 10
FlagDescriptionDefault
tickersOne or more ticker symbols
--hostTWS hostDEFAULT_HOST
--portTWS portDEFAULT_PORT
--client-idClient IDDEFAULT_CLIENT_ID
--outputCustom output CSV path
--widthStrikes per chain, 0=ALL (default: {STRIKE_WIDTH})STRIKE_WIDTH
--short-termShort-term mode: LEAPS 180-450d (default: 180+)False
--leaps-dteOverride LEAPS DTE range (e.g. --leaps-dte 180 365)
--hedge-dteOverride hedge DTE range (default: {HEDGE_DTE_MIN} {HEDGE_DTE_MAX})
--income-dteOverride income DTE range (default: {INCOME_DTE_MIN} {INCOME_DTE_MAX})
--parallelNumber of parallel IBKR connections (default: 1). Each worker4
runs/CSVs/{TICKER}_{TIMESTAMP}.csv Columns: ticker, type (LEAPS/HEDGE/INCOME), strike, expiry, bid, ask, iv, delta, gamma, theta, vega, volume, open_interest
Step 1 β€” Export chains during market hours
python3 fortress_export.py NVDA MSTR

Step 2 β€” Run optimizer on saved CSV (no IBKR needed)
python3 fortress_v26.py ~/fortress/runs/CSVs/NVDA_*.csv
πŸ“‹
CSV-only output
This tool exports option chains to CSV only.
Feed the CSV to fortress_v26.py for the dashboard.
Sample CSV path:
runs/CSVs/NVDA_20260407_143022.csv
πŸ’°
GS Put Seller
gs_put_seller.py β€” ~1200 lines
Goldman Sachs "Art of Put Selling" screener. Finds optimal puts by FCF yield targets (1x / 2x / 3x monthly FCF). Specific tickers or SPX/QQQ/IWM discovery mode.
HTML dashboard IBKR or yfinance
Specific tickers
python3 gs_put_seller.py --tickers MSFT AAPL NVDA GOOG
Discovery mode (screen index constituents)
python3 gs_put_seller.py --scan --top 10
No IBKR, specific expiry
python3 gs_put_seller.py --tickers QQQ SPY --no-ibkr --expiry 20260515
Capital sizing + force rescan
python3 gs_put_seller.py --scan --capital 500000 --collateral-pct 25 --rescan
FlagDescriptionDefault
--tickersSpace-separated ticker symbols
--scanDiscovery mode: screen SPX, QQQ, IWM constituentsFalse
--topTop N stocks per index in discovery mode (default: 10)10
--expiryTarget expiration (YYYYMMDD). Auto-selects nearest monthly 20-45 DTE if omitted
--capitalTotal portfolio capital for position sizing
--collateral-pctCollateral %% per put (100=fully collateralized, default: 100)100
--portTWS port (default: 0 = auto-detect TWS/Gateway)DEFAULT_PORT
--no-ibkrUse yfinance instead of IBKR for options dataFalse
--min-oiMinimum open interest filter (default: 100)100
--max-spread-pctMaximum bid-ask spread as %% of bid (default: 15.0)15.0
--outputOutput directory for HTML reportstr(Path.home(
--rescanForce fresh discovery scan, ignore cacheFalse
deploy/gs_putseller/{TICKER1}_{TICKER2}.html (also staged to deploy/ for CF Pages)
deploy/gs_putseller/MSFT_AAPL_NVDA_GOOG_QQQ_SPY.html
β†— open full