Watch how to download trading robots for free
Find us on Twitter!
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

MQL5 Source Code Library for MetaTrader 5

icon

This is the largest free source code library for MetaTrader 5 platform programs. Here you can find ready-made Expert Advisors, technical indicators, scripts and libraries. Use the code library when learning MQL5 language and develop your own automated trading applications based on the provided codes.

You can freely download and test published codes, as well as launch them in MetaTrader 5. The library is also available directly from MetaTrader 5 platform and MetaEditor development environment.

Submit your code

A native MQL5 tool that reconstructs closed positions from deal-level history, flags the ones closed through more than one exit, and reprices each one at its own first, last, and best exit rates to measure whether scaling out actually added value. Reports a Value-Add Ratio, a Scale Out Win Rate, an Efficiency figure, and a single-trade dependence check, combined into an A+ to F score with recommendations. Runs out of the box against a built-in demonstration data set; a companion script exports the real input file from your own account history. Pure MQL5, no external libraries.

Automatic structure-based SL, breakeven, ATR trailing, and dollar-based profit protection for manual MT5 trades and pending orders on Gold and selected FX pairs.

Marks non-repainting swing highs and lows using configurable LeftBars / RightBars pivots. Sends push and email alerts on each new confirmed swing.

Draggable Entry, Stop-Loss and Take-Profit lines with a live on-chart panel that calculates the exact lot size for a chosen account risk. No manual math, no guessing — drag the lines, read the size.

Free open-source MT5 read-only chart utility that scores current trend conditions and builds broker-normalized long and short risk plans. It uses moving-average direction and slope, ADX, Efficiency Ratio, ATR, spread, account currency and symbol specifications. It never opens, modifies or closes trades.

Set your risk %, drag the stop, and get the exact lot size priced in your account currency — margin and target included. Calculates only, never trades.

Checks a hypothetical MT5 market or pending order against current symbol, volume, tick-size, stop-distance and filling rules without sending a trade.

Prints a privacy-conscious snapshot of the current MT5 broker, account, symbol and terminal environment to the Experts log for diagnostics and support.

Open-source indicator combining moving-average direction, ADX and Kaufman's Efficiency Ratio into a transparent trend-condition score. Informational only; no trade execution.

A non-repainting Stochastic-based indicator that generates buy and sell signals based on extreme zone crossovers, featuring an alternating signal filter and bar-close alerts.

Plots the previous trading day's High, Low and Close as horizontal reference levels across the current session, with optional multi-day history for context. No repainting, no discretion — the levels are read directly from the completed Daily bar

On-chart trade management utility for MetaTrader 5 designed exclusively to adjust existing manual or EA positions. Features one-click controls for Break-Even placement, point offsets, profit locking, trailing stops, Risk-to-Reward (1R–3R) Take Profit targets, and volume-validated partial closures (25%–100%). Includes a draggable chart GUI and filtering by symbol and direction. Does not open new trades.

Professional open-source Candle Strength Analyzer for MetaTrader 5. Analyzes candle body, upper and lower wicks, buyer/seller pressure, rejection, range expansion and candle strength in real time.

Professional open-source Moving Average Dashboard for MetaTrader 5. Monitors EMA 20, EMA 50, EMA 100, EMA 200, SMA 50 and SMA 200 with price position, trend structure, MA Score and overall market bias.

Professional open-source Multi-Timeframe MACD Dashboard for MetaTrader 5. Analyzes MACD Main, Signal and Histogram across M1, M5, M15, M30, H1, H4 and D1 with an overall momentum score and market bias.

Professional open-source Multi-Timeframe RSI Dashboard for MetaTrader 5. Analyzes RSI across M1, M5, M15, M30, H1, H4 and D1 to monitor momentum, overbought and oversold conditions in real time.

Professional open-source Multi-Timeframe Trend Dashboard for MetaTrader 5. Analyzes M1 to D1 using EMA 20, EMA 50 and price position to identify Bullish, Bearish and Neutral market conditions.

Professional open-source Market Volatility Monitor for MetaTrader 5. Analyzes current ATR, average ATR, ATR ratio, daily range and spread to classify market volatility in real time.

Professional open-source Drawdown Monitor for MetaTrader 5. Tracks current, daily and peak-equity drawdown, floating P/L, margin levels and configurable account risk conditions in real time.

Professional open-source Trade Statistics Dashboard for MetaTrader 5. Analyzes trading history with win rate, profit factor, reward/risk, streaks, BUY/SELL performance, lot statistics and floating P/L.

Professional open-source Symbol Information Dashboard for MetaTrader 5. Displays live prices, spread, tick value, contract size, lot limits, swaps, trading conditions, daily range and ATR in real time.

Professional open-source Trading Session Monitor for MetaTrader 5. Tracks Sydney, Tokyo, London and New York sessions, overlaps, countdowns, spread, ATR and real-time market activity.

Professional open-source Account Health Monitor for MetaTrader 5. Monitors balance, equity, margin, drawdown, exposure and trading conditions with a real-time 0-100 Account Health Score.

Professional open-source Daily Profit and Loss Monitor for MetaTrader 5. Tracks daily closed profit, losses, floating P/L, win rate, daily return and configurable profit targets and loss limits.

Professional open-source Drawdown Monitor for MetaTrader 5. Monitors balance, equity, floating P/L, current drawdown, daily performance, peak equity and maximum drawdown with configurable risk levels.

Professional open-source Trading Journal Panel for MetaTrader 5. Analyzes closed trades and displays win rate, profit factor, net profit, average results and account performance in a real-time dashboard.

Professional open-source Trading Clock for MetaTrader 5. Displays broker server time, local time, UTC and Sydney, Tokyo, London and New York market times with live session status and overlap information.

Professional open-source Market Status Dashboard for MetaTrader 5. Monitor spread, ATR volatility, volume activity, daily range, ADR usage, trading sessions and overall market conditions in real time.

Quantora Symbol Information Panel MT5 - Professional Trading Specifications Dashboard

Professional open-source Pip Value Calculator for MetaTrader 5. Calculates broker-specific pip and point values using real symbol specifications, lot size, tick size, tick value and account currency.

Professional open-source ADR Calculator for MetaTrader 5. Calculates Average Daily Range, current day range, ADR usage percentage, remaining range and projected ADR High/Low levels with a modern Quantora dashboard.

Professional open-source Session Clock for MetaTrader 5. Displays Sydney, Tokyo, London and New York trading sessions with live status, countdown timers, progress bars, overlap information and configurable alerts.

Displays a complete trading statistics table directly on the chart — Net Profit, Profit Factor, Drawdown, Win Rate and more — calculated from your full account history. Purely informational, free for everyone.

Locks in the high and low of any user-defined session — Asian, London, New York, or a fully custom window — and draws it on the chart as a live-updating box or line pair. No repainting, no discretion — the range is measured directly from the bars, not estimated.

Professional open-source Candle Countdown for MetaTrader 5. Displays a live digital candle timer, progress bar, elapsed and remaining time, market status and configurable countdown alerts with a modern Quantora dashboard.

Professional open-source Margin Calculator for MetaTrader 5. Calculates required margin, Free Margin impact, Margin Level, position value and margin safety with a modern Quantora dashboard.

Professional open-source Risk Calculator for MetaTrader 5. Calculates money risk, account risk percentage, potential profit, Reward-to-Risk ratio, margin requirement and risk level.

Professional open-source Position Size Calculator for MetaTrader 5. Calculates broker-compatible lot size using account value, risk percentage, fixed risk amount and Stop Loss distance.

Professional open-source Trailing Stop manager for MetaTrader 5 with adjustable start, distance, step, profit filter, Magic Number filtering and a modern Quantora dashboard.

Professional open-source Break Even manager for MetaTrader 5. Automatically moves Stop Loss to Break Even with adjustable trigger, offset, Magic Number filtering and a modern Quantora dashboard.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202