How ravindhu/algo-lab works
AlgoLab is a MetaTrader 5 forex trading system with alert-only and order-execution paths. The principal workflow scans market history or live data, filters and validates signals, applies risk and safety guards, then alerts or executes through the broker adapter; results and operational state feed the dashboard. Separate workflows validate strategies, tune parameters, and discover/promote candidates under human approval. Edges use the excerpts, SOURCE INDEX references, or README statements; unsampled subsystem links are omitted where ownership is unclear.
Main entry points: live/pipeline.py Live cycle · cli.py CLI commands · ops/pipeline.py Alert-only cycle · validate.py Validation gate
Components 28
Signals and analysis
- Signal scanner
src/algolab/framework/scanner.py - Signal analyst
src/algolab/agent/multi_agent.py - Ollama client
src/algolab/llm/ollama_client.py - LLM budget
src/algolab/llm/budget.py - Alert-only cycle
src/algolab/ops/pipeline.py
Live trading
- Framework strategies
src/algolab/framework/strategies - Shared indicators
src/algolab/framework/strategies/indicators/hm.py - Framework runner
src/algolab/live/framework_runner.py - Live cycle
src/algolab/live/pipeline.py - MT5 adapter
src/algolab/live/adapter.py
Validation and research
- Legacy backtest
src/algolab/backtest/engine.py - Validation gate
src/algolab/backtest/validate.py - Parameter tuning
src/algolab/optimize/autotune.py - ML filter
src/algolab/ml/model.py - Strategy discovery
src/algolab/discovery_factory.py - Candidate promotion
src/algolab/discovery_promote.py
Operations and state
- Runtime profile
src/algolab/profile.py - Loss limits
src/algolab/ops/risk.py - Alerts
src/algolab/ops/alerts.py - Operational state
src/algolab/ops/state.py - Trade journal
src/algolab/ops/journal.py - Agent memory
src/algolab/memory/store.py
User interfaces
- CLI commands
src/algolab/cli.py - Dashboard
src/algolab/dashboard/app.py
Other components
- Operator
- User
- Ollama service
- MetaTrader 5
Connections 32
- Operator → CLI commands: runs commands
- CLI commands → Runtime profile: loads settings
src/algolab/cli.py - Signal analyst → Signal scanner: scans signals
src/algolab/agent/multi_agent.py - Signal analyst → LLM budget: uses budget
src/algolab/agent/multi_agent.py - LLM budget → Ollama client: wraps analyst
src/algolab/agent/multi_agent.py - Ollama client → Ollama service: sends chat
src/algolab/llm/ollama_client.py - Alert-only cycle → Signal analyst: reviews signals
src/algolab/ops/pipeline.py - Alert-only cycle → Loss limits: checks limits
src/algolab/ops/pipeline.py - Alert-only cycle → Alerts: sends alerts
src/algolab/ops/pipeline.py - Alert-only cycle → Operational state: reads and writes
src/algolab/ops/pipeline.py - Live cycle → Validation gate: checks gate
src/algolab/live/pipeline.py - Live cycle → MT5 adapter: reads account
src/algolab/live/pipeline.py - Live cycle → Framework runner: runs cycle
src/algolab/live/pipeline.py - MT5 adapter → MetaTrader 5: connects directly
- Framework runner → Framework strategies: asks strategies
- Framework strategies → Shared indicators: uses indicators
src/algolab/framework/strategies/indicators/__init__.py - Validation gate → Legacy backtest: tests legacy rule
src/algolab/backtest/validate.py - Validation gate → Framework runner: replays live path
src/algolab/backtest/validate.py - Validation gate → Operational state: records gate
src/algolab/backtest/validate.py - Parameter tuning → Legacy backtest: evaluates candidates
src/algolab/optimize/autotune.py - Parameter tuning → ML filter: fits filter
src/algolab/optimize/autotune.py - Strategy discovery → Candidate promotion: produces candidates
src/algolab/discovery_promote.py - CLI commands → Strategy discovery: runs discovery
src/algolab/cli.py - CLI commands → Candidate promotion: promotes candidate
src/algolab/cli.py - CLI commands → Parameter tuning: runs tuning
src/algolab/cli.py - Dashboard → Operational state: reads status
src/algolab/dashboard/app.py - Dashboard → Trade journal: reads trades
src/algolab/dashboard/app.py - Dashboard → Agent memory: reads calibration
src/algolab/dashboard/app.py - User → Dashboard: views monitor
- Live cycle → Loss limits: checks limits
src/algolab/live/pipeline.py - Live cycle → Operational state: locks and records
src/algolab/live/pipeline.py - Live cycle → Alerts: reports breaches
src/algolab/live/pipeline.py