Skip to content

Repository files navigation

ORBIS — Quant Alpha Engine

Production-grade quant platform for Opening Range Breakout strategy and multi-factor alpha generation.

Built for the YC Hedge Fund Competition. Designed to scale to $100M+ AUM. Deployed on free/freemium infrastructure.


Architecture

ORBIS
├── engine/              Python quant core
│   ├── orb_scanner.py   15-min ORB signal generation
│   ├── signal_engine.py Pipeline orchestrator
│   ├── score_model.py   Regime-aware composite scoring
│   ├── trade_plan.py    Deterministic trade plan generation
│   ├── risk_manager.py  Circuit breakers + position sizing
│   └── strategies/      Pluggable alpha modules
│       ├── momentum.py      Cross-sectional factor ranking
│       ├── stat_arb.py      Cointegration pair scanner
│       ├── vol_regime.py    ATR regime detection
│       └── earnings_drift.py  PEAD model
├── backtest/            Institutional backtesting framework
│   ├── runner.py        Event-driven simulator
│   ├── metrics.py       Sharpe, Sortino, Max DD, Profit Factor
│   └── report.py        Equity curves + PR comment generator
├── data/                Multi-source data feeds
│   ├── feeds.py         Aggregator (routes to best source)
│   ├── us_feed.py       yfinance + Alpha Vantage
│   ├── nse_feed.py      NSE India via yfinance
│   └── cache.py         Upstash Redis + in-memory fallback
├── api/                 FastAPI backend
│   ├── main.py          App entry + lifespan
│   └── routes/          /signals, /plans, /backtest, /config
├── dashboard/           Next.js frontend (Vercel)
│   ├── app/             App Router pages
│   ├── components/      React components
│   └── lib/             API client + Supabase
├── supabase/            Database schema + migrations
└── .github/workflows/   CI/CD pipeline

Core Strategy: 15-Minute Opening Range Breakout

Signal Classification: LONG / SHORT / WATCH / INSIDE

Rule Checklist (all must pass for execution):

Rule Description Default
R1 Gap filter |gap%| ≥ 0.3%
R2 Volume filter vol ≥ 500K
R3 Range filter ORB range ≤ 5%
R4 Breakout confirm Price beyond ORB-H/L
R5 Relative volume RVOL ≥ 1.0x
R6 Time window Within market hours
R7 Risk:Reward R:R ≥ 1.5
R8 AI confirmation Optional

Scoring: Weighted composite (R:R 25%, Volume 20%, Range 15%, Gap 15%, Signal 15%, AI 10%)

Quick Start

Backend (Python)

cd orbis
cp .env.example .env          # Fill in your API keys
pip install -r requirements.txt
uvicorn api.main:app --reload --port 8000

Dashboard (Next.js)

cd orbis/dashboard
npm install
echo "NEXT_PUBLIC_API_URL=http://localhost:8000" > .env.local
npm run dev

Run Backtest

cd orbis
python -c "
from engine.config import get_settings
from backtest.runner import BacktestRunner, BacktestConfig
from backtest.report import console_report
from data.us_feed import LIQUID_UNIVERSE
import yfinance as yf

settings = get_settings()
runner = BacktestRunner(settings, BacktestConfig())
data = {}
for sym in LIQUID_UNIVERSE[:10]:
    df = yf.download(sym, period='1y', interval='1d', progress=False)
    if not df.empty:
        data[sym] = df.rename(columns={'Open':'open','High':'high','Low':'low','Close':'close','Volume':'volume'})
result = runner.run(data)
print(console_report(result))
"

Free API Stack

Service Purpose Tier
yfinance US/NSE OHLCV Free, no key
Alpha Vantage Supplemental data 25 req/day
Supabase Postgres + Realtime 500MB free
Vercel Dashboard hosting Free hobby
Railway API hosting $5 credit
Upstash Redis Cache + rate limit 10K req/day
GitHub Actions CI/CD 2000 min/month
Telegram Bot Signal alerts Free
Sentry Error monitoring 5K events/month

CI/CD Pipeline

Trigger Action
PR to main Lint → Test → Backtest → Post metrics as PR comment
Push to main Deploy API (Railway) → Deploy dashboard (Vercel) → Telegram notify
Cron (09:30 IST) Run ORB scan → Push to Supabase → Telegram top 3 signals

Quality Gate: PRs are blocked if backtest Sharpe < 0.5 or Max Drawdown > 15%.

Risk Management

  • Max risk per trade: 1% of equity
  • Max daily loss: 3% → halt new trades
  • Circuit breaker: 5% drawdown → kill switch
  • Max concurrent positions: 5
  • LIVE_TRADING=false by default in every environment

Environment Variables

See .env.example for all required and optional configuration.

Critical: API keys are NEVER hardcoded. All secrets flow through:

  • Local: .env (gitignored)
  • CI/CD: GitHub Secrets
  • Production: Vercel/Railway environment variables

License: Private — YC Hedge Fund Competition

LIVE_TRADING is set to false. This is a research and competition platform.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages