How munquantsociety/mqs-backtest-visualizer works
MQS Backtest Visualizer is a backend for submitting quantitative backtests and viewing completed results. The principal workflow is a member submitting a run through the HTTP API; a job manager dispatches execution to a process pool, the engine runs a strategy against market data and produces a report, and successful reports are persisted for retrieval. Separate capabilities include strategy validation and storage, market context, and report exports. The README documents these capabilities, but several route and worker implementations were not sampled; uncertain internal links are omitted or marked unverified.
Main entry points: router.py API router · backtest_engine.py Backtest engine · job_manager.py Job manager · market_context.py Market context
Components 20
HTTP API
- API router
src/api/router.py - Backtest routes
src/api/routes/backtests.py - Strategy routes
src/api/routes/strategies.py - Context routes
src/api/routes/market_context.py
Run orchestration
- Job manager
src/workers/job_manager.py - Run worker
src/workers/run_job.py - Backtest service
src/services/backtests.py
Backtest engine
- Backtest engine
engine/core/backtest_engine.py - Strategy runtime
engine/strategies/portfolio_BASE/strategy.py - Report analytics
engine/analytics/reporting.py
Data and persistence
- Market data
engine/data/fmp.py - Application database
src/db/engine.py - Completed reports
src/repositories/reports.py - News database
src/db/engine.py
Product capabilities
- Strategy validation
src/services/strategy_validation - Strategy storage
src/integrations/strategy_store.py - Market context
src/services/market_context.py - Report exports
src/services/report_exports.py
Other components
- Member
- Frontend
Connections 20
- Member → Frontend: views results
README.md - Frontend → API router: sends requests
src/api/router.py - API router → Backtest routes: mounts
src/api/router.py - API router → Strategy routes: mounts
src/api/router.py - API router → Context routes: mounts
src/api/router.py - Backtest routes → Backtest service: handles submission
- Backtest service → Job manager: registers runs
- Job manager → Run worker: dispatches work
- Run worker → Backtest engine: executes run
- Backtest engine → Strategy runtime: runs strategy
engine/core/backtest_engine.py - Backtest engine → Market data: loads history
engine/core/backtest_engine.py - Backtest engine → Report analytics: builds report
engine/core/backtest_engine.py - Job manager → Completed reports: saves success
src/workers/job_manager.py - Completed reports → Application database: persists reports
- Strategy routes → Strategy validation: validates submissions
- Strategy validation → Strategy storage: uses storage
- Context routes → Market context: serves context
src/api/routes/market_context.py - Market context → News database: reads news
src/services/market_context.py - Market context → Application database: reads prices
src/services/market_context.py - Report exports → Completed reports: exports reports