How cmirlop/agenttrading works
AgentTrading is a Forex trading-agent system with live/dry-run analysis and historical research workflows. The clearest sampled live path is the dry-run pipeline: it checks broker/session and candidate eligibility, loads market state, builds a trade plan, and validates an order without enabling Python trading. Historical replay and backtesting are distinct product branches. The README gives no further capability details; unsampled modules are included where the source index identifies major components, but their internal behavior and some connections remain unverified.
Main entry points: orchestrator.py Agent Orchestrator · run_dry_pipeline.py Dry-run Pipeline · run_multiagent_historical_replay.py Multi-agent Replay · run_stateful_backtest.py Stateful Backtest
Components 33
Live Trading
- Dry-run Pipeline
run_dry_pipeline.py - Session Gate
src/session_gate.py - Candidate Gate
src/candidate_gate.py - Trade Planner
src/trade_planner.py - Risk Validator
src/risk_validator.py
Agent Analysis
- Agent Orchestrator
src/orchestration/orchestrator.py - Decision Context
src/orchestration/decision_context.py - Agent Bus
src/orchestration/agent_bus.py - Regime Agent
src/agents/regime_agent.py - Strategy Agent
src/agents/strategy_agent.py - Critic Agent
src/agents/critic_agent.py - Decision Agent
src/agents/decision_agent.py - Structured LLM Client
src/agents/llm_client.py
Historical Research
- Historical Trade Planner
src/historical_trade_planner.py - Historical Execution
src/historical_execution.py - Historical Risk
src/historical_risk.py - Multi-agent Replay
run_multiagent_historical_replay.py - Stateful Backtest
run_stateful_backtest.py - Candidate Scan
scan_backtest_candidates.py
Market Data
- Market Snapshot
src/market_snapshot.py - Historical Market State
src/historical_state.py - Technical Evaluator
src/technical_evaluator.py - Support Resistance
src/support_resistance.py - Level Price Action
src/level_price_action.py - Calendar Gate
src/calendar_gate.py
Configuration
- Agent Configuration
config/agent_config.py - Backtest Configuration
config/backtest_config.py - Market Configuration
config/market_config.py - Operational Configuration
config/operational_config.py - Risk Configuration
config/risk_config.py - Planner Configuration
config/trade_planner_config.py
Other components
- Operator
- MetaTrader 5
Connections 37
- Operator → Dry-run Pipeline: starts
- Dry-run Pipeline → MetaTrader 5: checks account
run_dry_pipeline.py - Dry-run Pipeline → Session Gate: builds session
run_dry_pipeline.py - Dry-run Pipeline → Candidate Gate: checks candidate
run_dry_pipeline.py - Dry-run Pipeline → Trade Planner: builds plan
run_dry_pipeline.py - Dry-run Pipeline → Risk Validator: validates order
run_dry_pipeline.py - Dry-run Pipeline → MetaTrader 5: checks order
run_dry_pipeline.py - Agent Orchestrator → Decision Context: creates context
src/orchestration/orchestrator.py - Agent Orchestrator → Agent Bus: publishes messages
src/orchestration/orchestrator.py - Agent Orchestrator → Market Snapshot: builds snapshot
src/orchestration/orchestrator.py - Agent Orchestrator → Regime Agent: dispatches analysis
src/orchestration/orchestrator.py - Agent Orchestrator → Strategy Agent: dispatches analysis
src/orchestration/orchestrator.py - Agent Orchestrator → Critic Agent: invokes on approval
src/orchestration/orchestrator.py - Agent Orchestrator → Decision Agent: requests decision
src/orchestration/orchestrator.py - Regime Agent → Structured LLM Client: requests assessment
src/agents/regime_agent.py - Multi-agent Replay → Historical Market State: loads state
run_multiagent_historical_replay.py - Multi-agent Replay → Historical Trade Planner: plans trades
run_multiagent_historical_replay.py - Multi-agent Replay → Historical Execution: simulates execution
run_multiagent_historical_replay.py - Multi-agent Replay → Historical Risk: evaluates risk
run_multiagent_historical_replay.py - Multi-agent Replay → Agent Orchestrator: runs agents
- Stateful Backtest → Historical Market State: loads state
run_stateful_backtest.py - Stateful Backtest → Historical Trade Planner: plans trades
run_stateful_backtest.py - Stateful Backtest → Historical Execution: simulates execution
run_stateful_backtest.py - Stateful Backtest → Historical Risk: evaluates risk
run_stateful_backtest.py - Candidate Scan → Historical Market State: loads state
scan_backtest_candidates.py - Candidate Scan → Market Snapshot: builds snapshot
scan_backtest_candidates.py - Candidate Scan → Technical Evaluator: evaluates technicals
scan_backtest_candidates.py - Candidate Scan → Session Gate: checks session
scan_backtest_candidates.py - Session Gate → Operational Configuration: reads settings
src/session_gate.py - Structured LLM Client → Agent Configuration: reads model settings
src/agents/llm_client.py - Historical Market State → Market Configuration: reads market settings
src/historical_state.py - Historical Trade Planner → Planner Configuration: reads plan settings
src/historical_trade_planner.py - Historical Risk → Risk Configuration: reads risk settings
src/historical_risk.py - Stateful Backtest → Backtest Configuration: uses evaluation settings
run_stateful_backtest.py - Agent Orchestrator → Support Resistance
- Agent Orchestrator → Level Price Action
- Dry-run Pipeline → Calendar Gate: reads calendar state
run_dry_pipeline.py