Skip to main content

India Macro-Momentum Regime Dashboard

Project description

๐Ÿงญ Nautilus

Best free open-source India macro-momentum regime dashboard โ€” powered by yfinance, real RBI data, and a 5-state Gaussian HMM.

100% local ยท zero cloud cost ยท zero paid APIs ยท zero synthetic data.

What it does

  • Fetches Nifty 50 prices (^NSEI) and the India 10Y G-Sec yield (NIFTYGS10YR.NS) via yfinance.
  • Loads RBI repo rate from a bundled historical CSV (public domain).
  • Fits a 5-state Gaussian HMM on price volatility + macro features.
  • Applies a risk-gate overlay (not aggressive Kelly scaling) that preserves India's upward drift in bull markets while going cash during confirmed Panic regimes.
  • Renders an interactive Streamlit dashboard with regime shading, bond yield panel, Williams VixFix, equity curve backtest, and CSV exports.

Quickstart

git clone https://github.com/chrislernunes/Nautilus
cd Nautilus

python -m venv .venv
# Linux/macOS:
source .venv/bin/activate
# Windows MSYS2 UCRT64:
source .venv/Scripts/activate

pip install -e ".[dev]"
pip install hmmlearn   # enables 5-state HMM

streamlit run src/nautilus/dashboard/regime_dashboard.py

v5 Regime Multipliers

Regime Multiplier Rationale
Bull Quiet 1.00ร— Full exposure โ€” ride India's drift
Bull Volatile 1.00ร— Still bullish directionally
Neutral 0.75ร— Mild reduction
Stress 0.35ร— Meaningful cut
Panic 0.00ร— Cash

Previous v4 used 0.40ร— for Neutral and 0.15ร— for Stress โ€” this averaged ~0.55ร— across bull markets, destroying ~45 pp of return with no compensating benefit. BigBeluga is fully removed.

Project structure

nautilus/
โ”œโ”€โ”€ data/
โ”‚   โ””โ”€โ”€ rbi_repo_rate.csv       # Bundled RBI repo rate history (public domain)
โ”œโ”€โ”€ src/nautilus/
โ”‚   โ”œโ”€โ”€ config.py               # Paths, tickers, defaults
โ”‚   โ”œโ”€โ”€ etl/
โ”‚   โ”‚   โ”œโ”€โ”€ loader.py           # yfinance + Parquet cache
โ”‚   โ”‚   โ””โ”€โ”€ macro.py            # Real RBI repo + NIFTYGS10YR.NS bond yield
โ”‚   โ”œโ”€โ”€ strategies/
โ”‚   โ”‚   โ”œโ”€โ”€ momentum.py         # MA signal, WVF, cross-sectional momentum
โ”‚   โ”‚   โ””โ”€โ”€ regime.py           # HMM fitting + regime containers
โ”‚   โ”œโ”€โ”€ backtests/
โ”‚   โ”‚   โ””โ”€โ”€ engine.py           # Vectorized backtest (no double-shift)
โ”‚   โ””โ”€โ”€ dashboard/
โ”‚       โ””โ”€โ”€ regime_dashboard.py # Streamlit app
โ””โ”€โ”€ tests/
    โ””โ”€โ”€ test_engine.py          # Unit tests

Data sources

Data Source Cost
Nifty 50 prices ^NSEI via yfinance Free
Stock universe .NS tickers via yfinance Free
10Y G-Sec yield NIFTYGS10YR.NS via yfinance Free
RBI repo rate Bundled CSV (RBI press releases, public domain) Free

No Quandl. No FRED. No Bloomberg. No API keys.

Updating RBI repo rate

After each MPC meeting, add a new row to data/rbi_repo_rate.csv:

2025-06-06,5.75

Then click ๐Ÿ”„ Refresh Data in the sidebar.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nautilus_spark-0.5.1.tar.gz (34.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nautilus_spark-0.5.1-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

Details for the file nautilus_spark-0.5.1.tar.gz.

File metadata

  • Download URL: nautilus_spark-0.5.1.tar.gz
  • Upload date:
  • Size: 34.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for nautilus_spark-0.5.1.tar.gz
Algorithm Hash digest
SHA256 3f9cd24c4824a43dc42587063bc245fd319c9531038f8163031144fcc830f3bb
MD5 f1549532f859c0c560b1f3497d9df538
BLAKE2b-256 b5078256d2079b0c6e435e2803993eeb7544e41b0ef9c1652a8826925efdf111

See more details on using hashes here.

File details

Details for the file nautilus_spark-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: nautilus_spark-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for nautilus_spark-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d587f3f6e4c8c61b88fd23c2acacd06c5a44e299a9a99a1b9cfadac175bbb05
MD5 1a84fe0bb4e050fda6fca99a966d8b56
BLAKE2b-256 c241e682dd52a85bb45e6b9be00d469bd45ecd1015af22ff66d89ebe130dc17c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page