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.2.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.2-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nautilus_spark-0.5.2.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.2.tar.gz
Algorithm Hash digest
SHA256 4fec7b7cc84927f9b18bb97410c7437e2a59b3081fc498ce6d908b8fb34b956c
MD5 0e6f347414ac18e126953e042d22e658
BLAKE2b-256 82414aa111a1a3865b40452ea01e935748136ed4ad6145609e338deb23487664

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nautilus_spark-0.5.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b2158887270112f825142c0769053ffcf92a2712edaf4fc6ab7a6c8366541ea0
MD5 012d6edc6833a1cc3db16bab71a835f3
BLAKE2b-256 2aed81c1499635a5019e5592e8528705cda7b7a28ae581f280dcef545cdda275

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