Version 1.1.0 | Universal AI skill for creating production-ready MetaTrader 5 Expert Advisors with a survival-first approach.
An AI skill that teaches Claude, ChatGPT, Gemini, and other AI assistants how to generate compile-ready, professional MQL5 Expert Advisors with emphasis on capital preservation over maximum returns.
- β Compile-Ready Code - All templates verified in MetaEditor
- β Production-Grade - Real-world risk management, not backtest fantasies
- β Universal - Works with any AI that processes Markdown
- β Safety-First - Mandatory risk controls, warnings for dangerous strategies
# Upload SKILL.md to your Claude skills directory
# Claude auto-applies it when generating EAs- Create Custom GPT
- Upload
SKILL.mdto Knowledge Base - System instructions: "Follow MQL5 EA Expert skill guidelines"
- Include
SKILL.mdin conversation context - Or paste relevant sections when needed
Test it:
Create an RSI strategy EA with:
- RSI period 14, overbought 70, oversold 30
- 1% risk per trade
- Daily loss limit 5%
Expected: Compile-ready .mq5 file with proper risk management β
mql5-ea-expert/
βββ SKILL.md # Core AI skill (load this into your AI)
βββ evals.json # 8 test cases for skill validation
βββ .gitignore
βββ CHANGELOG.md # Version history
βββ LICENSE # MIT + Trading Disclaimer
βββ README.md # You are here
βββ FIX_SUMMARY.md # Technical review results
βββ AI_SETUP_GUIDE.md # Platform-specific setup instructions
βββ UPLOAD_GUIDE.md # How to upload to GitHub
βββ GITHUB_DESCRIPTIONS.md # SEO descriptions
- Professional EA Structure - Organized inputs, error handling, logging
- Multi-Timeframe Analysis - Trend confirmation across H4/H1/M15
- Money Management - Fixed risk, Kelly Criterion, adaptive risk
- Safe Grid System - Grid trading with drawdown caps
- Ultra-Safe Martingale - Martingale with forced safety limits
- Automatic risk per trade <= 1%
- Daily loss limit <= 5%
- Max drawdown protection <= 20%
- Spread filters, time filters, margin checks
- Magic number position tracking
The skill instructs AI to:
- Always restate requirements before coding
- Always include comprehensive risk management
- Refuse to remove safety features
- Warn about grid/martingale dangers
- Output compile-ready, commented code
"The best EA is the one that survives, not the one with highest returns."
- Capital Preservation > Maximum Profit
- Risk-Adjusted Returns - 50% @ 10% DD > 200% @ 60% DD
- Market Adaptability - Works in trend/range/high vol/low vol
- Edge Validation - Every strategy needs measurable, logical edge
- Psychological Robustness - Executable without panic
- Profit Factor > 1.5
- Win Rate: 40-60% (sustainable)
- Max Drawdown < 20%
- Recovery Factor > 3
- Sharpe Ratio > 1.0
8 test cases covering:
- Simple MA crossover with full risk management
- Multi-timeframe alignment strategy
- Safe grid system (max levels, DD protection)
- Advanced money management (Kelly Criterion)
- Backtest validator (metrics calculation)
- Survival-focused EA (all protections combined)
- Martingale with safety caps (refuses dangerous configs)
- Strategy with multiple filters (spread, time, volatility)
Run test:
# Ask your AI:
"Using the MQL5 EA Expert skill, create [eval test case prompt]"
# Verify:
- Code compiles in MetaEditor β
- Includes expected risk management β
- Uses proper MQL5 API (handles + CopyBuffer) β
- Can lead to large drawdowns
- Must have max level limits
- Must have strict drawdown protection
- Best in ranging markets only
- HIGHLY DANGEROUS - Can wipe out account
- Skill forces multiplier <= 1.5, steps <= 4
- Use ONLY in low volatility, ranging markets
- Demo test minimum 6 months
- 90% of traders fail due to poor risk management
- EA is a tool, not a money machine
- Never risk money you can't afford to lose
- Always test thoroughly: 3+ years backtest, 3+ months demo
- AI Setup Guide - Platform-specific instructions
- Upload Guide - How to upload this repo to GitHub
- Changelog - Version history and fixes
- Fix Summary - Technical review report
- β Fixed all compile-breaking MQL5 errors
- β Corrected indicator handle usage (iMA, iRSI, iATR, iBands)
- β Fixed CTrade API signatures (PositionModify, PositionClose)
- β Fixed pointer syntax in examples
- β Added AI Response Contract
- β Converted to English for universal compatibility
- MetaTrader 5 terminal
- Basic understanding of MQL5 (AI generates code, you review)
- Patience for proper testing (backtesting + demo)
- β Claude (Anthropic)
- β ChatGPT (OpenAI)
- β Gemini (Google)
- β Copilot (Microsoft)
- β LLaMA, Mistral, and other open-source models
- β Any AI that can process Markdown documentation
MIT License - See LICENSE for details
This software is for educational purposes only. Trading forex, CFDs, and leveraged products carries high risk. Past performance is not indicative of future results. The creators are not responsible for any financial losses. Always conduct your own research and consult a licensed financial advisor before trading.
Found a bug? Have an improvement?
- Open an issue describing the problem
- Submit a PR with fixes
- Include test case if adding features
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with β€οΈ for traders who prioritize survival over profit
Last updated: February 12, 2026