Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Access the CodeBase from your MetaTrader 5 terminal
Couldn't find the right code? Order it in the Freelance section
How to Write an Expert Advisor or an Indicator

MQL4 and MQL5 Source Code Library

icon

You don't know where to start learning the MQL5 or MQL4 programming language? Various programs for your MetaTrader terminal are available here. Download and study published code examples, develop your own indicators and Expert Advisors. Publish your applications in the largest library of MQL5 and MQL4 codes, and they will be available in every MetaTrader terminal and MetaEditor.

Your code examples in MQL4 and MQL5 will be distributed worldwide, and thousands of traders will know about you!

Submit your code

A professional intermarket analysis tool. It overlays the USD Index (DXY) on any chart to identify SMT Divergences and institutional correlation shifts in real-time.

A lightweight, essential utility for ICT and SMC traders. It automatically plots the True Daily, Weekly, and Monthly Open prices, serving as the foundation for the Power of 3 (Accumulation, Manipulation, Distribution) concept.

A high-precision indicator designed to detect institutional liquidity sweeps (stop hunts). It identifies price rejection beyond recent swing levels, marking potential high-probability reversal zones without lagging indicators.

An institutional-grade dashboard that breaks down your open positions and calculates your true net lot exposure per individual currency, preventing invisible systemic risks and over-leveraging.

Technical Details Uses MQL5's OrderSend with TRADE_ACTION_DEAL for instant market closure at current Bid/Ask prices. Includes slippage tolerance (10 points), proper volume matching, and magic number preservation. Loops backward through positions to prevent index shifting during execution.

ZigZag SNR Detection identifies support and resistance levels using ZigZag pivot points.

This EA serves as a template for traders interested in automating strategies in MT5. It implements a Moving Average crossover system and can be used as-is or customized by adjusting its settings. The free source code is designed to be easily modified for adding new indicators, logic, and trading features.

This Expert Advisor (EA) is designed to detect swing highs and lows on the H4 timeframe, then wait for sweeps (liquidity grabs) on the M15 timeframe to trigger buy/sell trades with defined risk management.

Multi-timeframe CRT Indicator(Explorer) that detects higher timeframe setups and projects CRH/CRL levels onto lower timeframe charts using Fibonacci objects for clear, real-time context.

A professional trade management utility that completely hides your Stop Loss and Take Profit levels from brokers. It features a Spread Protector to prevent virtual stop-outs during news events or daily rollovers.

This Expert Allows You To Run and Play DOOM (The Game) on MetaTrader5! It's A Take On The Infamous "Can It Run Doom?" Challenge.

A clean, lightweight, and non-repainting indicator that automatically detects and draws Smart Money Concepts (SMC) Fair Value Gaps (FVG) directly on your chart across any timeframe.

The standard MACD on MT5 platform seem to be not enough so I code this version by copying from the pinescript.

Regime-adaptive grid EA with three operating modes (BGT/TGT/MGT), ATR-dynamic spacing, CUSUM change-point detection, equity-based cycle management, and a full CSV diagnostics pipeline. Based on the Bi-Directional Grid Constrained (BGC) stochastic process research by Taranto & Khan (2020–2022).

Heikin Ashi overlay (color candles or line) with 5 smoothing methods, step filter, MTF, signal arrows, strength meter, dashboard, and 4-channel alerts (popup/sound/push/email). Free.

Complete SMC toolkit: BOS/CHoCH detection, Order Blocks (internal + swing), Fair Value Gaps, Equal Highs/Lows, Premium/Discount zones, Strong/Weak H/L, trend candles, dashboard, 4-channel alerts. Free.

NeuroPro Verbalisation Converter for MQL5

A strict Multi-Timeframe Price Action Expert Advisor that trades based on precise OHLC conditions across different timeframes simultaneously. It features pending order entries, role reversals, and dynamic risk management without using any lagging indicators.

A JSON library designed for massive use of LLMs and lower latency.

Just two timeframes — H1 and D1 — work synchronously to filter out the noise and capture only strong RSI reversals from overbought and oversold zones. No random entries, only a clear confirmation of the direction from the "big brother."

ExMachina Supply & Demand Zones is a professional indicator that automatically detects supply and demand zones on any chart using impulse-based detection with ATR filtering. Version 2.0 introduces multi-candle impulse detection, full range measurement, zone merging, touch tracking, proximity alerts, and an ExMachina dark theme that transforms your chart into a professional trading workspace.

Highlights Inside Bar candlestick patterns on the chart and provides optional popup and push alerts when a new pattern is detected.

Trade With MA Trends ATR TPSL Line and The Line Of Pivot Point

A lightweight tick-driven dashboard that reveals short-term Bid-Ask pressure directly on the chart.

Monitoring memory consumption.

A high-precision trend reversal indicator combining RSI exhaustion zones with candlestick breakout patterns.

Connect your MetaTrader 5 account to Telegram. Receive instant notifications every time a trade opens, closes, or gets modified — directly in your phone. This is a notification-only Expert Advisor. It does not place, modify, or close any trades. It monitors your account activity and sends formatted messages to your Telegram chat via the Bot API.

This is a minimalist CRT (Candle Range Theory) visualizer built in under 100 lines, revealing what “picture-perfect” single-timeframe setups actually produce across real markets.

SilviosEAbest26 is a high-precision Expert Advisor for MetaTrader 5, designed to trade market reversals using a sophisticated combination of dynamic price channels and momentum filters. The system is engineered for consistent returns while maintaining strict risk management protocols.

Real-time prop firm rule tracker: daily drawdown, max drawdown, profit target progress, trading days count, and challenge status with visual progress bars. Presets for FTMO, MyFundedFX, E8, TFT, and Bulenox. Pure indicator — no trade interference.

Professional trade management panel: one-click Buy/Sell with auto lot sizing, smart trailing stop (ATR/Fixed/Candle), automatic breakeven, multi-TP partial close system (TP1/TP2/TP3), and one-click pending orders. All-in-one order management for serious traders.

This is an experimental Last Structure Break (LSB) price action indicator that uncovers meaningful market structures and potential trading edges through intelligent support and resistance analysis.

ExMachina Safe Scalping is a professional-grade Expert Advisor built for conservative breakout scalping on Gold (XAUUSD), Silver (XAGUSD), and Forex majors.

Include-file class that measures inter-tick latency, filters false alarms via a self-normalising ATR volatility gate, and broadcasts persistent lag alerts to other EAs via GlobalVariable IPC.

Include class that validates combined terminal ping + execution latency before trade operations. Returns false if threshold is exceeded.

Combine Multi Timeframe Trends into one trend using MA.

Draws the previous day High, Low, and Close as horizontal reference lines on the chart for a configurable number of past days. Yesterday's levels extend into today as live support and resistance, with optional touch alerts.

Trade using MA. An easy indicator to identify the trend direction on a specific timeframe.

A simple trading strategy based on breakouts of prior Highs and Lows.

Modern Time Panel for MT5 The Modern Time Panel is a sleek, minimalist custom indicator for MetaTrader 5 that helps you track time with precision. Fixed neatly at the top-right corner of your chart, it displays the current Broker Time, Local Time, and a live countdown to the next candlestick (New Bar). Built with an independent 1-second timer, the countdown continuously runs even when the market is slow or there are no incoming ticks. Fully customizable and dark-mode friendly, it is the perfect non-intrusive tool to ensure you never miss a candle close.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196