How 2023ai/ftmo-risk-control works
This is an FTMO account risk-control service with MT5/cTrader adapters and a separate qualification dashboard. The principal workflow is platform account/trade data → authenticated HTTP evaluation → risk decision and persisted execution state → platform execution reporting. Calendar and qualification-history ingestion support that workflow, while qualification remains separate from the per-trade gate. The API’s calls to the engine, store, and qualification logic are supported by the SOURCE INDEX; unsampled implementation details and the MT5 adapter’s exact HTTP interactions are not inferred.
Main entry points: risk_api.py HTTP risk API · RiskGuardBot.cs cTrader bot · state_store.py SQLite state · sync_news.py News calendar sync
Components 14
Trading platforms
- cTrader bot
platform/ctrader/RiskGuardBot.cs - MT5 adapter
platform/mt5/RiskGuardEA.mq5
Risk service
- HTTP risk API
src/risk_api.py - Risk engine
src/risk_engine.py
Persistent state
- SQLite state
src/state_store.py - State backup
scripts/backup_state.py - State restore
scripts/restore_state.py
Qualification tracking
- Qualification calculations
src/qualification.py - Qualification dashboard
dashboard/qualification.html
Reviewed data ingestion
- News calendar sync
scripts/sync_news.py - Market closure sync
scripts/sync_market.py - History sync
scripts/sync_qualification.py
Other components
- Trading account
- Administrator
Connections 17
- Trading account → cTrader bot: initiates trades
README.md - Trading account → MT5 adapter: initiates trades
README.md - cTrader bot → HTTP risk API: requests evaluation
platform/ctrader/RiskGuardBot.cs - HTTP risk API → Risk engine: evaluates risk
src/risk_api.py - HTTP risk API → SQLite state: persists state
src/risk_api.py - HTTP risk API → Qualification calculations: calculates progress
src/risk_api.py - HTTP risk API → cTrader bot: returns decisions
platform/ctrader/RiskGuardBot.cs - cTrader bot → HTTP risk API: reports execution
platform/ctrader/RiskGuardBot.cs - HTTP risk API → Qualification dashboard: serves dashboard
README.md - Administrator → News calendar sync: reviews calendar
README.md - News calendar sync → HTTP risk API: uploads events
scripts/sync_news.py - Administrator → Market closure sync: reviews closures
README.md - Market closure sync → HTTP risk API: uploads closures
scripts/sync_market.py - Administrator → History sync: reviews history
README.md - History sync → HTTP risk API: uploads history
scripts/sync_qualification.py - State backup → SQLite state: backs up
scripts/backup_state.py - State restore → SQLite state: restores state
scripts/restore_state.py