How sagan-research/sagan-trade works
Sagan Trade is a quantitative research and trading library: users derive transparent alpha signals from market data, manage exposure with risk and regime filters, and evaluate strategies through fee-aware backtesting. The repository also contains separate WQB alpha-mining and NIFTY research workflows, plus a Streamlit trading dashboard. README claims identify additional model, microstructure, and portfolio capabilities, but their internal wiring is not established by the sampled source; those are shown as distinct components without inferred call chains.
Main entry points: orchestrator.py Batch Orchestrator · backtest_engine.py Backtest Engine · symbolic_regressor.py Symbolic Regressor · api.py WQ Brain API
Components 24
Signal Research
- Symbolic Regressor
sagan_trade/symbolic_regressor.py - Feature Engineering
sagan_trade/feature_engineering.py - Market Microstructure
sagan_trade/market_microstructure.py - Forecast Models
sagan_trade/tft_model.py - PINN Models
sagan_trade/pinn_models.py
Risk And Evaluation
- Asymmetric Risk
sagan_trade/asymmetric_risk_engine.py - Volatility Regime
sagan_trade/volatility_regime_filter.py - Backtest Engine
sagan_trade/backtest_engine.py - Advanced Backtesting
sagan_trade/backtesting_advanced.py - Portfolio Optimization
sagan_trade/portfolio_optimization.py - Firestore Store
sagan_trade/firestore_client.py - Trading Dashboard
dashboard/app.py
Research Workflows
- Research Runner
nifty_quant_pipeline/run_pipeline.py - Quant Research
nifty_quant_pipeline/research_engine.py
WQB Alpha Mining
- WQB CLI
WQB_Submission/main.py - Batch Orchestrator
WQB_Submission/core/orchestrator.py - Expression Generator
WQB_Submission/core/generator.py - WQ Brain API
WQB_Submission/core/api.py - Alpha Evaluator
WQB_Submission/core/evaluator.py
Other components
- Quant User
- Market Data
- Market Data Provider
- Research Report
- WQ Brain Service
Connections 29
- Quant User → Symbolic Regressor: trains and predicts
- Market Data → Symbolic Regressor: provides prices
- Symbolic Regressor → Feature Engineering: synthesizes indicators
- Quant User → Asymmetric Risk: requests sizing
- Quant User → Volatility Regime: requests signals
- Quant User → Backtest Engine: runs strategy
- Asymmetric Risk → Backtest Engine: supplies risk model
- Volatility Regime → Backtest Engine: supplies filter
- Symbolic Regressor → Backtest Engine: supplies alpha
- Backtest Engine → Quant User: returns metrics
- Quant User → Advanced Backtesting: evaluates strategy
- Quant User → Portfolio Optimization: optimizes holdings
- Quant User → Market Microstructure: requests analysis
- Quant User → Forecast Models: uses forecasts
- Quant User → PINN Models: uses forecasts
- Quant User → Trading Dashboard: views and configures
- Quant User → Research Runner: starts research
- Research Runner → Quant Research: runs research
- Quant Research → Market Data Provider: downloads prices
- Quant Research → Research Report: returns metrics
- Research Runner → Research Report: writes JSON
- Quant User → WQB CLI: starts mining
- WQB CLI → Batch Orchestrator: starts loop or batch
- Batch Orchestrator → Expression Generator: generates expressions
- Batch Orchestrator → WQ Brain API: dispatches simulations
- WQ Brain API → WQ Brain Service: simulates and submits
- WQ Brain Service → WQ Brain API: returns results
- Batch Orchestrator → Alpha Evaluator: ranks results
- Batch Orchestrator → WQ Brain API: submits best alpha