Skip to content

Universal MQL5 EA development skill for all AI models (Claude, ChatGPT, Gemini). Survival-focused Expert Advisor creation with advanced risk management, multi-timeframe analysis, and battle-tested trading strategies. Includes comprehensive templates, money management systems, and backtesting validators. πŸ€–πŸ“ˆ

License

Notifications You must be signed in to change notification settings

nawf-dev/mq5_skills

Repository files navigation

MQL5 EA Expert - Professional AI Skill

Version 1.1.0 | Universal AI skill for creating production-ready MetaTrader 5 Expert Advisors with a survival-first approach.

License: MIT MQL5


🎯 What is This?

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.

Key Differentiators

  • βœ… 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

πŸš€ Quick Start

For Claude (Anthropic)

# Upload SKILL.md to your Claude skills directory
# Claude auto-applies it when generating EAs

For ChatGPT (OpenAI)

  1. Create Custom GPT
  2. Upload SKILL.md to Knowledge Base
  3. System instructions: "Follow MQL5 EA Expert skill guidelines"

For Other AI

  • Include SKILL.md in 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 βœ…


πŸ“ Repository Structure

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

πŸ’‘ What You Get

Core Templates

  • 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

Safety Built-In

  • Automatic risk per trade <= 1%
  • Daily loss limit <= 5%
  • Max drawdown protection <= 20%
  • Spread filters, time filters, margin checks
  • Magic number position tracking

AI Response Contract

The skill instructs AI to:

  1. Always restate requirements before coding
  2. Always include comprehensive risk management
  3. Refuse to remove safety features
  4. Warn about grid/martingale dangers
  5. Output compile-ready, commented code

πŸ“Š Skill Philosophy

"The best EA is the one that survives, not the one with highest returns."

Core Principles

  1. Capital Preservation > Maximum Profit
  2. Risk-Adjusted Returns - 50% @ 10% DD > 200% @ 60% DD
  3. Market Adaptability - Works in trend/range/high vol/low vol
  4. Edge Validation - Every strategy needs measurable, logical edge
  5. Psychological Robustness - Executable without panic

Safety Metrics

  • Profit Factor > 1.5
  • Win Rate: 40-60% (sustainable)
  • Max Drawdown < 20%
  • Recovery Factor > 3
  • Sharpe Ratio > 1.0

πŸ§ͺ Validation

8 test cases covering:

  1. Simple MA crossover with full risk management
  2. Multi-timeframe alignment strategy
  3. Safe grid system (max levels, DD protection)
  4. Advanced money management (Kelly Criterion)
  5. Backtest validator (metrics calculation)
  6. Survival-focused EA (all protections combined)
  7. Martingale with safety caps (refuses dangerous configs)
  8. 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) βœ…

⚠️ Important Warnings

Grid Trading

  • Can lead to large drawdowns
  • Must have max level limits
  • Must have strict drawdown protection
  • Best in ranging markets only

Martingale

  • 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

General

  • 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

πŸ“– Documentation


πŸ› οΈ Technical Details

Version 1.1.0 Fixes

  • βœ… 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

Requirements

  • MetaTrader 5 terminal
  • Basic understanding of MQL5 (AI generates code, you review)
  • Patience for proper testing (backtesting + demo)

Compatibility

  • βœ… Claude (Anthropic)
  • βœ… ChatGPT (OpenAI)
  • βœ… Gemini (Google)
  • βœ… Copilot (Microsoft)
  • βœ… LLaMA, Mistral, and other open-source models
  • βœ… Any AI that can process Markdown documentation

πŸ“œ License

MIT License - See LICENSE for details

Trading Disclaimer

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.


🀝 Contributing

Found a bug? Have an improvement?

  1. Open an issue describing the problem
  2. Submit a PR with fixes
  3. Include test case if adding features

🌟 Support


Made with ❀️ for traders who prioritize survival over profit

Last updated: February 12, 2026

About

Universal MQL5 EA development skill for all AI models (Claude, ChatGPT, Gemini). Survival-focused Expert Advisor creation with advanced risk management, multi-timeframe analysis, and battle-tested trading strategies. Includes comprehensive templates, money management systems, and backtesting validators. πŸ€–πŸ“ˆ

Resources

License

Stars

Watchers

Forks

Packages

No packages published