MQL5 Code Guides for MetaTrader 5
Browse Expert Advisor examples, indicator implementations and API tutorials by task. Source code is a starting point for review and testing; inclusion here does not establish profitability or broker compatibility.
The guides are publicly readable. Coding Agent access follows the current Pineify plan.
23
EA examples
15
Strategy guides
23
Indicator guides
31
Tutorials
Choose a guide for the job
- EA examples: inspect the actual signal, order and risk logic. Check broker symbol names, point sizes, trading sessions and netting or hedging assumptions.
- Indicator guides: trace handles, buffers and bar indexing. An indicator display is not an executable strategy or a verified trading result.
- Tutorials: isolate one API or development task. Some examples are function fragments and need a surrounding program before compilation.
- Strategy guides: define a test protocol, including costs and out-of-sample data. A testing guide does not supply evidence of a profitable backtest.
Asset + Strategy Expert Advisors
Bitcoin MT5 Expert Advisor: BTCUSD MQL5 Example and Test Plan
Asset + Strategy · BTCUSD
Bollinger Bands H4 EA MQL5: Volatility Breakout Trading System
Asset + Strategy · Multi-pair
BTC Scalper EA MT5: Bitcoin MQL5 Scalping Code & 2026 Guide
Asset + Strategy · BTCUSD
Crude Oil Expert Advisor MT5: XTIUSD MQL5 EA Code & Guide
Asset + Strategy · XTIUSD
Crypto Expert Advisor MT5: Bitcoin, Ethereum & Altcoin EA Guide
Asset + Strategy · Crypto
EURUSD Scalping EA MT5: M5 EMA Example & Test Guide
Asset + Strategy · EURUSD
EURUSD Trend Following EA MQL5: Multi-Timeframe Confirmation Bot
Asset + Strategy · EURUSD
FTMO EA MQL5: Rule Verification and Risk-Guard Example
Asset + Strategy · Multi-pair
GBPJPY Expert Advisor MQL5: High-Volatility Scalping Strategy
Asset + Strategy · GBPJPY
GBPUSD Expert Advisor MT5: M15 EMA/RSI Code and Test Plan
Asset + Strategy · GBPUSD
Gold Expert Advisor MT5: Free MQL5 Source and Testing Steps
Asset + Strategy · XAUUSD
Gold Grid EA MT5: MQL5 Mechanics and Exposure Limits
Asset + Strategy · XAUUSD
Gold Scalping EA MT5: XAUUSD M5 Code and Testing Guide
Asset + Strategy · XAUUSD
Gold SMC EA MT5: Smart Money Concept Expert Advisor for XAUUSD
Asset + Strategy · XAUUSD
Gold Trend Following EA MT5: MQL5 XAUUSD Trend Strategy & Code
Asset + Strategy · XAUUSD
MACD M15 Expert Advisor MQL5: Intraday Momentum EA
Asset + Strategy · Multi-pair
NAS100 EA MT5: Opening-Range Code and Server-Time Limits
Asset + Strategy · NAS100
Silver XAGUSD Expert Advisor MQL5: Commodity Trend-Following System
Asset + Strategy · XAGUSD
SP500 Expert Advisor MT5: US500 MQL5 EA Code & Backtest Guide
Asset + Strategy · SP500
US30 EA MT5: Complete Expert Advisor Guide for Dow Jones Trading
Asset + Strategy · US30
US30 Scalping EA MT5: Dow Jones Expert Advisor with MQL5 Code
Asset + Strategy · US30
USDJPY Scalping EA MQL5: Low-Spread Intraday Momentum Strategy
Asset + Strategy · USDJPY
XAUUSD Expert Advisor MT5: H1 EMA/ADX MQL5 Example and Test Guide
Asset + Strategy · XAUUSD
Strategy Guides
Forex Scalping EA MT5: M5 EMA, RSI and ATR Code Example
Strategy Guide · Forex
Indices Trading Robot MT5: Multi-Symbol MQL5 EA Example
Strategy Guide · US30/NAS100
MetaTrader Automated Trading with MQL5 Expert Advisors
Strategy Guide · Multi-pair
MQL5 Breakout EA: Opening Range Breakout Code & Backtest Guide
Strategy Guide · Multi-pair
MQL5 EA for Funded Traders: Rule Review and Risk-Guard Example
Strategy Guide · Multi-pair
MQL5 Expert Advisor Free Source: EMA/RSI Template and Setup
Strategy Guide · Multi-pair
MQL5 Grid Trading EA: Full Code, Risk Management & Optimization
Strategy Guide · Multi-pair
MQL5 Hedging EA: Hedging Account Strategy Code & Risk Guide
Strategy Guide · Multi-pair
MQL5 Martingale Grid Strategy: Combined EA Code, Risk & Backtest
Strategy Guide · Multi-pair
MQL5 Mean Reversion Strategy: Bollinger/RSI EA and Test Boundaries
Strategy Guide · Multi-pair
MQL5 News Trading EA: Audit a Manual Event Straddle
Strategy Guide · EURUSD/GBPUSD
MQL5 Scalping EA: M5 EMA Crossovers and ATR Sizing
Strategy Guide · Multi-pair
MQL5 Swing Trading EA: H4 Signals and ATR Stop Logic
Strategy Guide · Multi-pair
MQL5 Trend Following EA: H1 EMA and ADX Code
Strategy Guide · Multi-pair
Night Scalper EA MT5: MQL5 Asian Session Scalping Code & Guide
Strategy Guide · EURUSD/GBPUSD
Indicator Code
ADX MQL5 Indicator Code: Trend Strength Measurement with DI Cross
Indicator Code · Multi-pair
ATR Trailing Stop H1 MQL5: Volatility-Adaptive Stop Loss & Exit Strategy
Indicator Code · Multi-pair
CCI MQL5 Indicator Code: Commodity Channel Index Overbought/Oversold System
Indicator Code · Multi-pair
Custom Indicator MQL5: Complete Coding Tutorial for Traders 2026
Indicator Code · Multi-pair
RSI & MACD Divergence MQL5 Indicator: Automated Regular & Hidden Divergence Detection
Indicator Code · Multi-pair
EMA Indicator MT5: MQL5 Custom EMA Code, Multi-EMA & EA Integration
Indicator Code · Multi-pair
EMA M5 Scalping MQL5 Indicator: Moving Average Momentum on 5-Minute Chart
Indicator Code · Multi-pair
Auto Fibonacci MQL5 Indicator: Automatic Retracement & Extension Levels
Indicator Code · Multi-pair
Heikin Ashi MQL5 Indicator: Candle Buffers, EMA Overlay and Alerts
Indicator Code · Multi-pair
Keltner Channel MQL5 Indicator: ATR Bands and Completed-Bar Alerts
Indicator Code · Multi-pair
MACD H1 MQL5 Indicator: Completed-Bar Crosses and EMA Filter
Indicator Code · Multi-pair
MACD MQL5 Indicator: Difference Histogram and Closed-Bar Alerts
Indicator Code · Multi-pair
Parabolic SAR MQL5 Indicator: Trailing Stop & Trend Reversal Detection
Indicator Code · Multi-pair
Pivot Points MQL5 Indicator: Daily, Weekly & Monthly Support/Resistance Levels
Indicator Code · Multi-pair
QQE MQL5 Indicator: Smoothed RSI Variant and Closed-Bar Alerts
Indicator Code · Multi-pair Forex / Indices
RSI H4 MQL5 Indicator: Swing Trading with Multi-Timeframe RSI Confluence
Indicator Code · Multi-pair
RSI M15 Scalping MQL5 Indicator: Fast Momentum Entries with RSI
Indicator Code · Multi-pair
Stochastic H4 Swing Trading MQL5: Oscillator Reversal Entry System
Indicator Code · Multi-pair
Supertrend H1 MQL5 Indicator: Hourly Trend Direction & Entry Signals
Indicator Code · Multi-pair
MT5 Supertrend Indicator: MQL5 Code and Alerts
Indicator Code · Multi-market
VWAP D1 MQL5: Rolling Daily Price–Volume Average
Indicator Code · Multi-pair
VWAP Indicator MT5: MQL5 Custom VWAP Code, Usage & Download
Indicator Code · Multi-pair
Williams %R MQL5 Indicator: Overbought/Oversold System & EA Integration
Indicator Code · Multi-pair
Tutorials
AI MQL5 Code Generator: Generate Expert Advisors with AI (2026)
Tutorial · Multi-pair
MQL5 ArrayResize Function Guide: Dynamic Arrays & Dimension Rules
Tutorial · General MQL5
ATR Indicator MQL5: Custom Code, Stop-Loss Sizing & EA Integration
Tutorial · Multi-pair
Best MT5 Expert Advisor 2026: How to Choose & What to Avoid
Tutorial · Multi-pair
Bollinger Bands MT5 Indicator: MQL5 Custom Code, Squeeze & EA
Tutorial · Multi-pair
MQL5 ObjectCreate & OnChartEvent Guide: UI Buttons & Event Handling
Tutorial · General MQL5
MQL5 Classes, Structs & Inheritance: OOP Architecture Guide
Tutorial · General MQL5
MQL5 CopyBuffer Function Guide: Indicator Buffers, Handles & EA Examples
Tutorial · Multi-asset
MQL5 CopyTicks & CopyTicksRange: Real-Time & Historical Tick Data
Tutorial · General MQL5
MQL5 CTrade Class Guide: Buy, PositionClose & PositionModify Signatures
Tutorial · Multi-asset
MQL5 Datetime Guide: TimeToString, TimeToStruct & Session Filter Code
Tutorial · General MQL5
MQL5 Economic Calendar API: CalendarValueHistory & News Filter Code
Tutorial · Forex & Macro
MQL5 FileOpen Guide: Reading & Writing CSV Files in MetaTrader 5
Tutorial · General MQL5
Ichimoku Cloud MT5 Indicator: MQL5 Code, Trading Rules & EA
Tutorial · Multi-pair
MQL5 Magic Number Guide: Filtering, CTrade and Netting Limits
Tutorial · General MQL5
Moving Average MQL5: iMA Methods and a Crossover EA Example
Tutorial · Multi-pair
Create MQL5 Expert Advisor Without Coding: Beginner's Complete Guide
Tutorial · Multi-pair
MQL5 Martingale EA: Audit the Sizing Logic and Recovery Claims
Tutorial · Multi-pair
MQL5 Risk Management: Position Sizing Code Templates & Guide
Tutorial · Multi-pair
MT5 Arbitrage EA Guide: Pairs Signals and Execution Limits
Tutorial · Multi-pair
MT5 Expert Advisor Tutorial: Complete Beginner Guide to MQL5 EAs 2026
Tutorial · Multi-pair
MT5 Strategy Tester Guide: How to Backtest Expert Advisors (2026)
Tutorial · Multi-pair
MQL5 OrderSend Guide: MqlTradeRequest, Return Codes & Execution Code
Tutorial · General MQL5
MQL5 PositionSelect Guide: Netting vs Hedging & Position Properties
Tutorial · General MQL5
MQL5 Close Array in Expert Advisor: CopyRates & CopyClose Guide
Tutorial · General MQL5
MQL5 Printf, PrintFormat & Comment: Logging & Chart Displays
Tutorial · General MQL5
RSI MQL5 Indicator: Custom Alert, Multi-Timeframe & EA Integration
Tutorial · Multi-pair
Stochastic Oscillator MT5: MQL5 Alert Indicator, Code & EA Guide
Tutorial · Multi-pair
MQL5 String Conversion Guide: EnumToString, Number Conversions & Formatting
Tutorial · General MQL5
MQL5 Trailing Stop Code: Complete EA Function with CTrade & Step Logic
Tutorial · Multi-asset
MQL5 in VS Code: Setup Compiler, IntelliSense & AI Workflow Guide
Tutorial · General MQL5
Don't see the MQL5 EA you need?
Describe the required program type, entry and exit rules, symbol conventions and account mode. Review the proposed source and compilation diagnostics, then test the result in MetaTrader 5.
Explore the MQL5 coding workflow