MQL4 Source Code Library for MetaTrader 4

icon

The largest library features codes of free trading Expert Advisors, technical indicators and scripts. With the available applications you can trade in automated mode and analyze price dynamics. Use the library of codes to learn more about financial market sentiments.

Download free applications, test them and run in your MetaTrader 4. You can access them from the MetaTrader 4 platform and the MetaEditor development environment.

Submit your code

One include file that encrypts texts and bytes so only a program with the same key can read them. A wrong key or a changed message is refused instead of read as garbage, keys can come from a password, and the code is checked against the official NIST and RFC test vectors.

Risk-based lot size for MQL4 that does not depend on MODE_TICKVALUE in the Strategy Tester, so backtests of USDJPY, USDCHF or USDCAD on a USD account risk what the input says. Includes a test EA that measures the error.

One include file that gives your EA or indicator keyboard shortcuts the user types into the inputs, such as Shift+B. Each press fires one action, Shift+B never fires on a plain B, and a shortcut that cannot work is refused at start with the reason.

Check the first and last available bars and the gaps between bars for a date range before a backtest in the MetaTrader 4 Strategy Tester.

A script that sets your own margin call and stop-out levels above the broker's. It alerts when the margin level falls below your margin call level and, below your stop-out level, closes open orders one at a time, the worst net result first, until the level is back up, the way a broker stop-out works.

One include file that reads and writes JSON in MQL4. It refuses broken JSON and tells you the line and column of the mistake, keeps numbers exact, reads and writes UTF-8 files, and saves your EA's settings to a file and loads them back.

Saves your closed MT4 trades to a CSV file for your spreadsheet: one row per trade with points, costs, net result, MAE and MFE. Part closes are joined into one row.

Free MQL4 currency-strength dashboard with eight major currencies, ranking across up to 28 FX pairs, broker-symbol discovery and closed-bar data-quality checks. Standalone MIT-licensed source; no trading operations.

An advanced MT4 trade journal featuring automatic CSV logging, detailed performance statistics, per-symbol analytics, searchable trade history, and comprehensive CSV reports.

A free MT4 Forex seasonality indicator that analyzes historical price data to reveal weekday, weekly, and monthly market tendencies, bullish/bearish probabilities, average returns, and volatility through a modern statistical dashboard.

Free MT4 XAUUSD analysis indicator: completed Asian range, closed-bar liquidity sweeps, swing structure breaks, London/New York session context, H1 EMA trend and manual lot-risk planner. No automatic orders or guaranteed trading returns.

Free MT4 chart planner with draggable entry, stop and target levels, spread, risk-based lots, fees, estimated swap, break-even and net risk/reward. Indicator only; no orders.

Closed-bar sweeps of confirmed swing levels, with wick, volatility and freshness filters, liquidity lines, a dashboard and optional alerts.

Protects a prop-firm or personal MT4 account: daily loss limit, max drawdown (static or trailing) and profit-target lock. On a breach it closes all orders, deletes pending orders and keeps the account flat until the lock resets.

Tests any MT4 indicator for repainting: records what every buffer showed when each bar closed, reads the same bars again later and reports values that changed, signals that appeared late and signals that vanished, with dates.

Previous day high and low, previous week high and low and today's open as horizontal lines with small price labels, on any timeframe.

Draws the Tokyo, London and New York sessions of the last few days as boxes from each session's high to its low, with the high and low printed on the chart. Session hours are set in server time.

Countdown to the close of the current bar, the live spread in points and the time left until the next server midnight, when brokers roll positions over and charge swap.

A free, read-only utility. It reads an MT4 Strategy Tester report (.htm) and matches every backtest trade with your account history. It then shows the match rate, missed and extra trades, entry and exit slippage, delay, real commission and swap, and how much of the backtest edge survives live.

An MT4 port of QuantNomad's "UT Bot Alerts", one of the most-used scripts on TradingView. It draws the ATR trailing stop, Buy/Sell signals and bar colors, and adds a panel that counts what the signals would have done, after costs, inside your trading hours.

An MT4 port of the popular TradingView "Range Filter Buy and Sell 5min". The filter line only moves when price exceeds a smoothed average range, which filters out small swings. Includes Buy/Sell signals, target bands and bar colors, plus a signal statistics panel with a daily session filter.

An MT4 port of the classic Chandelier Exit as implemented by everget on TradingView (v6, 2025). It draws the long/short ATR stop from the highest or lowest close, Buy/Sell signals when the state flips, and a highlighted state fill, plus a signal statistics panel with a daily session filter.

Geminis, Mistral, Claude & Perplexity UNITED!!

OpenAI Trend-Following Trading System

Algorithm by DeepSeek AI

Trend coloured candles - By Mistral AI

Perplexity AI beautiful Trading System

Good tendency estimator, coloured candlesticks, by Claude AI

A stylish design view of the markets prices. Surf the trend!!

Set the number of convergence indicators to a reversion occur.

From MultiIndicatorDivergence - Show all Time-Frames 5 bars ago & bar actual.

STRATEGY BASED ON RSI, SAR, HEIKEN-ASHI, STOCHASTIC, CCI, WPR AND BULLS & BEARS

Metatrader 4 version identical to Mql5 indi!

Quant 2nd Model, by Gemini AI

Quant Ultimate Momentum Pro, by Gemini AI

Show Align Mean optimum all chart profit.

Combination optimum of sloping native MT4 indicators.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107