VeriTrade is a production-ready verification framework for algorithmic trading systems (Expert Advisors) on MetaTrader 5. The system autonomously verifies that a trading strategy executes correctly, safely, and profitably before deployment.
Verify before you trade - Never deploy an untested EA again.
- 🔍 Static Analysis - Code review and compliance checking
- 🏃 Runtime Testing - Execute EA and observe behavior in real-time
- ⚔️ Adversarial Testing - Edge cases and attack scenarios
- 🔄 Recovery Testing - Restart and recovery scenarios
- 📊 Evidence Collection - Screenshots, logs, and data capture
- 📈 Backtesting - Historical performance validation
- 🎯 Decision Engine - GO/NO-GO/NOT-PROVEN verdicts
- 🔒 Secure API - API key authentication and rate limiting
- 📝 Comprehensive Reports - HTML/JSON/Markdown output
┌─────────────────────────────────────────────────────────────┐
│ VeriTrade Framework │
├─────────────────────────────────────────────────────────────┤
│ ┌──────────────────────────────────────────────────────┐ │
│ │ 1. MCP Server Layer │ │
│ │ - MT5 Control with Error Handling │ │
│ │ - Tool Definitions │ │
│ │ - API Security │ │
│ └──────────────────────────────────────────────────────┘ │
│ │ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ 2. Verification Controller │ │
│ │ - Static Analysis │ │
│ │ - Runtime Testing │ │
│ │ - Backtesting │ │
│ │ - Evidence Collection │ │
│ └──────────────────────────────────────────────────────┘ │
│ │ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ 3. Reporting & Decision Engine │ │
│ │ - Test Results │ │
│ │ - Risk Assessment │ │
│ │ - GO/NO-GO/NOT-PROVEN Decision │ │
│ └──────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
# Clone the repository
git clone https://github.com/yourusername/veritrade.git
cd veritrade
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Install package
pip install -e .# Copy environment example
cp .env.example .env
# Edit with your MT5 credentials
nano .envpython scripts/run_server.py --port 8080 --host 0.0.0.0python scripts/run_verification.py --ea GridEA_PathB.mq5 --symbol EURUSD --timeframe H1python scripts/generate_report.py --run-id RUN-20260828-001 --format htmlfrom veritrade import VeriTrade
# Initialize
veritrade = VeriTrade()
# Run verification
result = veritrade.verify(
ea_file="GridEA_PathB.mq5",
symbol="EURUSD",
timeframe="H1",
test_types=["static", "runtime", "adversarial"]
)
# Check result
if result.verdict == "GO":
print("✅ Ready for production deployment")
elif result.verdict == "NO-GO":
print("❌ Needs fixes before deployment")
else:
print("⚠️ More testing required")VeriTrade/
├── src/
│ ├── mcp_server/ # MCP server implementation
│ ├── controllers/ # MT5 and verification controllers
│ ├── core/ # Core utilities (error handling, logging, config)
│ ├── models/ # Data models and schemas
│ ├── tests/ # Test implementations
│ └── utils/ # Utility functions
├── scripts/ # CLI scripts
├── configs/ # Configuration files
├── tests/ # Unit and integration tests
├── docs/ # Documentation
├── examples/ # Example EAs and notebooks
└── .claude/commands/ # Claude agent commands
# Run unit tests
pytest tests/unit/
# Run integration tests
pytest tests/integration/
# Run with coverage
pytest --cov=src tests/The system is production-ready when:
- ✅ All 6 phases implemented
- ✅ 80%+ code coverage
- ✅ End-to-end workflows work
- ✅ Complete documentation
- ✅ Security audit passed
- ✅ Verification < 30 minutes
- ✅ 99.9% uptime in testing
- ✅ All error scenarios handled
- ✅ Evidence collection working
- ✅ Accurate GO/NO-GO decisions
- ✅ Docker/PyPI deployment ready
- ❌ Never trade on live accounts during verification
- ❌ Never skip error handling for speed
- ❌ Never ignore evidence collection
- ❌ Never assume tests pass without verification
- ❌ Never deploy without GO decision
- ❌ Never modify production EA during verification
- ❌ Never use hardcoded credentials
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
This project is licensed under the MIT License - see the LICENSE file for details.
- MetaTrader5 team for the excellent Python integration
- MCP protocol contributors
- Trading community for best practices and insights
Remember: Verify before you trade! 🎯