How fernandog555/quant-backtest-engine works
quant-backtest-engine supports historical strategy research, backtesting, walk-forward validation, a GUI, and optional Webull paper/live execution. The research flow loads market bars, applies a strategy, simulates risk-controlled trades, and reports results; the live runner instead polls for new bars and routes sized orders through Webull. The graph preserves documented analytics and visualization capabilities. Some source was not sampled, so connections to those components are included only where the README or source index supports them.
Main entry points: run_backtest.py Backtest CLI · engine.py Backtest engine · base.py Strategy interface · orchestrator.py Trading orchestrator
Components 22
Research inputs
- Historical bars
src/data/loader.py
Strategies
- Strategy interface
src/strategies/base.py - Buy and hold
src/strategies/buy_and_hold.py - Moving average
src/strategies/moving_average_crossover.py - RSI mean reversion
src/strategies/rsi_mean_reversion.py
Backtesting
- Backtest engine
src/backtest/engine.py - Walk-forward validation
src/backtest/walk_forward.py - Trade analytics
src/backtest/trade_analytics.py - Result visualization
src/backtest/plotting.py
Risk controls
- Risk manager
src/risk/manager.py - Risk state store
src/risk/state_store.py
User interfaces and execution
- Backtest CLI
run_backtest.py - Research GUI
src/gui/main_window.py - Backtest worker
src/gui/worker.py - Scheduled live runner
run_live.py - Trading orchestrator
src/execution/orchestrator.py - Webull client
src/execution/webull_client.py - Order and position models
src/utils/models.py
Other components
- Researcher
- yfinance
- Webull API
- Research results
Connections 33
- Researcher → Backtest CLI: starts research
run_backtest.py - Backtest CLI → Historical bars: loads bars
run_backtest.py - Historical bars → yfinance: downloads bars
src/data/loader.py - Backtest CLI → Strategy interface: selects strategy
run_backtest.py - Buy and hold → Strategy interface: implements
src/strategies/buy_and_hold.py - Moving average → Strategy interface: implements
src/strategies/moving_average_crossover.py - RSI mean reversion → Strategy interface: implements
src/strategies/rsi_mean_reversion.py - Backtest CLI → Backtest engine: runs simulation
run_backtest.py - Backtest CLI → Walk-forward validation: validates windows
run_backtest.py - Backtest engine → Strategy interface: generates positions
src/backtest/engine.py - Backtest engine → Risk manager: checks risk
src/backtest/engine.py - Backtest engine → Trade analytics: pairs trades
src/backtest/engine.py - Walk-forward validation → Backtest engine: runs test windows
src/backtest/walk_forward.py - Walk-forward validation → Trade analytics: uses trade pairing
src/backtest/walk_forward.py - Backtest CLI → Result visualization: plots results
README.md - Result visualization → Backtest engine: renders results
src/backtest/plotting.py - Backtest CLI → Research results: reports results
run_backtest.py - Researcher → Research GUI: configures research
src/gui/main_window.py - Research GUI → Backtest worker: starts job
src/gui/main_window.py - Backtest worker → Historical bars: loads bars
src/gui/worker.py - Backtest worker → Backtest engine: runs simulation
src/gui/worker.py - Backtest worker → Walk-forward validation: validates windows
src/gui/worker.py - Scheduled live runner → Historical bars: loads latest bars
run_live.py - Scheduled live runner → Trading orchestrator: schedules runs
run_live.py - Scheduled live runner → Risk manager: resets risk day
run_live.py - Scheduled live runner → Risk state store: persists state
run_live.py - Trading orchestrator → Strategy interface: gets signal
src/execution/orchestrator.py - Trading orchestrator → Risk manager: sizes position
src/execution/orchestrator.py - Trading orchestrator → Webull client: previews and submits
src/execution/orchestrator.py - Webull client → Webull API: sends API requests
src/execution/webull_client.py - Trading orchestrator → Order and position models: creates orders
src/execution/orchestrator.py - Webull client → Order and position models: uses order models
src/execution/webull_client.py - Risk manager → Risk state store: serializes state
src/risk/manager.py