Skip to content

About

Evidence-first NSE index-options research engine + native macOS paper-trading app. ~1M backtested configs under a strict no-lookahead/after-cost honesty stack. Not financial advice.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

OptionsMaxx

An evidence-first research engine and macOS paper-trading app for NSE index options. Every rule the app enforces was earned by surviving ~1,000,000 backtested strategy configurations under a strict honesty stack — after costs, after slippage, with no lookahead. Nothing is asserted that the data didn't support, including the uncomfortable finding that the original 10%/month goal is not achievable at safe risk on this capital.

⚠️ Not financial advice. No warranty. Paper-trading only. Read NOTICE.md before anything else. All rights reserved — this repo is published for reading, not reuse.


What this is

A sister project to MoneyMaxx (equities), applying the same discipline to a different instrument: NSE index options (NIFTY primary, BANKNIFTY secondary), sized for a retail account (₹5,00,000), traded via Zerodha.

The charter (see SYSTEM.md) fixes one goal — few, high-conviction, defined-risk trades that a person with a full-time job can manage on a 5-minute cadence — and holds everything else falsifiable. The research pipeline then tests, ranks, and freezes a book of strategies before any UI is built.

The honest headline result (NIFTY-only, calibrated costs, 60 months):

Risk policy Total P&L ~Annualised Loss months
Charter 2.5% (₹12.5K max loss/position) +₹83,317 ~5.6%/yr 0
Relaxed 5% (₹25K max loss/position) +₹2,03,643 ~15.6%/yr 0

The system is deliberately silent in ~42 of 60 months — the paying regime is rare by design. The full derivation, graveyard of rejected strategies, and every caveat are in WHITEPAPER.md and lab/MMO-V1.md.


Repository layout

Path What's in it
SYSTEM.md The charter: goal, adopted constraints, evidence discipline, roadmap
WHITEPAPER.md Standalone methodology + results paper
lab/MMO-V1.md The canonical Phase-1/2 evidence report (~1M configs)
engine/ Pricing (BS IV/delta), the full Zerodha/NSE cost model, data-derived lot-size history, the structure simulator (settle marks, gap-through honesty, forced 2-DTE exit)
lab/ sweep.py (Stage-1 per-trade grid), portfolio.py (Stage-2 capital-aware replay), book.py — the frozen adopted book, MMO-V1.2, event/calendar tests
data/ NSE bhavcopy + VIX/spot downloaders (data itself is not committed — see below)
collector/ 5-minute live option-chain snapshot collector (NSE v3 API)
live/ Phase-3 paper loop: refresh → signal → monitor, deterministic tickets, positions ledger
tests/ pytest suite: IV round-trip, cost hand-checks, accounting reconciliation, no-lookahead perturbation test, stop/DTE semantics
app/ OptionsMaxx.app — native SwiftPM macOS app; Book.swift is parity-tested against the Python engine

The macOS app

A native menubar + full-window SwiftUI app. Paper-trading only — it connects to no broker and places no orders. Its trading logic (app/Sources/OptionsMaxx/Book.swift) is kept in lockstep with the frozen Python book and parity-tested against Python fixtures, so the app can never invent a rule the lab didn't validate.

Features: Auto paper mode (5-min in-app chain collector, entries/exits in the 15:00–15:25 window mirroring the backtest's at-close fills), Dashboard, Live/Past Opportunities (every refusal logged with its reason), Open Trades with live P&L and exit-plan progress, Analytics (equity / monthly / paper-vs-evidence), a beginner Learn section, and a Settings policy picker.

Install the prebuilt app (easiest)

  1. Download OptionsMaxx.app.zip from the Releases page and unzip it.
  2. Move OptionsMaxx.app to /Applications.
  3. The app is ad-hoc (self-)signed, so Gatekeeper will quarantine it on first launch. Clear the quarantine flag once:
    xattr -dr com.apple.quarantine /Applications/OptionsMaxx.app
    (Alternatively: right-click the app → Open → Open in the dialog.)
  4. Launch it. App state lives in ~/Library/Application Support/OptionsMaxx/.

Requirements: macOS 26 (Tahoe) or later, Apple Silicon or Intel (the release build is universal).

Build the app from source

cd app
./build_app.sh            # release .app into app/dist/ (universal when possible)
./build_app.sh install    # also copy to /Applications
./run_tests.sh            # Swift parity tests vs Python fixtures

Requires a Swift 6 toolchain (Xcode 26 or the matching command-line tools).


Running the research pipeline

The engine and lab are pure Python. Market data is not shipped — you regenerate it locally from public sources (this keeps the repo small and avoids redistributing third-party data).

# 1. Environment (the project path contains a space — always call venv explicitly)
python3 -m venv venv
./venv/bin/python -m pip install requests pandas pyarrow yfinance

# 2. Download data (public NSE / Yahoo sources; be gentle — throttled by design)
./venv/bin/python data/download_bhavcopy.py download --start 2019-01-01
./venv/bin/python data/download_bhavcopy.py consolidate
./venv/bin/python data/download_vix_spot.py

# 3. Verify the honesty stack
./venv/bin/python -m pytest tests/ -q      # includes the no-lookahead test

# 4. Reproduce the evidence
./venv/bin/python -m lab.sweep             # Stage-1 grid (~millions of trades)
./venv/bin/python -m lab.portfolio         # Stage-2 capital-aware replay + monthly tables

The frozen adopted book lives in lab/book.py — downstream code imports strategy definitions from there only.

The paper-trading loop (Phase 3)

./venv/bin/python -m live.refresh                  # nightly: refresh data + tomorrow's gate status
./venv/bin/python -m live.signal   [--enter]       # if gate open: deterministic entry ticket
./venv/bin/python -m live.monitor  [--close <id>]  # evaluate exit plans against conservative quotes

Principles this repo tries hard to honor

  • No lookahead — signals use nothing after the decision-time close; it's a test.
  • Costs are always on — STT, exchange/SEBI/stamp/GST, ₹20/order brokerage, and slippage calibrated against live quotes; never a gross number presented as net.
  • The structure is the stop — defined-risk only, no naked shorts, max loss bounded at entry by strike width.
  • The model froze before the UI — the app mirrors the lab, not the other way around.
  • Honesty over flattering backtests — a +₹5.5L result was retracted when it turned out to rest on unfillable panic-day marks. The whitepaper keeps the autopsy.

See NOTICE.md for copyright, the not-financial-advice disclaimer, and the no-warranty terms.

About

Evidence-first NSE index-options research engine + native macOS paper-trading app. ~1M backtested configs under a strict no-lookahead/after-cost honesty stack. Not financial advice.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages