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

WaveWeisBarForce is a custom indicator based on Weis Waves logic. It accumulates volume into directional waves (bullish or bearish) and displays them as histograms with intensity levels. Bullish waves: 4 levels of green, from light to Lime. Bearish waves: 4 levels of red, from light to Red. WaveMax (white): shows the bar with the highest volume inside each wave. WaveClimax (yellow): highlights record accumulated volume across waves. This indicator helps traders visualise market pressure by volume accumulation and wave intensity, improving intraday and swing analysis.

The goal is to show a code that shows the calculation of the ATR with Wilder smoothing

Expert Advisor based on iPinBar Pin Bar Finder + several different trailing indicators

A simple strategy based on the signals of two indicators: Williams' Percent Range (WPR) and Bollinger Bands (BB). A position is opened only when the signals of both indicators coincide.

It signals a period of low market volatility that is about to end, foreshadowing a significant price move.

Function to convert server time from one broker's time zone to another.

A set of classes for automatic moving of StopLoss of open positions by fixed indentation or by values of Parabolic SAR and moving averages indicators, or by specified position stop level.

MACD Histogram

Another ZigZag. ZigZag

A system to test up to four indicators concurrently in the strategy tester

This indicator calculate count of one direction movement in selected period.

It's the classic zigzag with a timeframe input to display a HTF zigzag on a LTF chart

A service for MetaTrader 5 that creates a synthetic custom symbol "USDX.synthetic" reflecting the US Dollar Index (DXY) in real time.

The script removes all autotrading icons from the current chart

The indicator searches the chart for Price Action patterns "Pin Bar" and puts icons on the bar with the found pattern.

Modification of the standard indicator Fractal

A simple information indicator that shows the remaining time until the bar closes, as well as the time elapsed since the bar opened and the current time.

This is an OHLC candlestick chart which records the highest ask and lowest bid on each new bar

Complete Telegram integration for MT5. Send trading signals, screenshots, reports & alerts to Telegram channels. Includes queue system, multi-channel support & risk management.

A candlestick chart which connects the ask price and bid price to the high and low of the candles

This is an auxiliary take profit and stop loss tool, which can help you to tight stop loss and dynamic take profit. Updated

A tool to align the trading sessions names with broker server time, and local time

A combination of many known indicators

I share my code for expert advisor babi ngepet

CandleMove - Pips & Percentage Movement Display A visual tool that helps you quickly gauge the strength of each candle by displaying its price change directly on the chart.

A channel which calculates local highs and local lows with volatility-adjusted lines

Simple_Grid is the simplest "grid" EA.

A simple yet effective RSI indicator that monitors overbought and oversold conditions on any symbol and timeframe. Sends instant alerts via pop-up and mobile notifications when RSI crosses your defined thresholds.

Quantum System - Uses quantum states and probabilities to make decisions.

PriceVar% is an indicator designed to measure the percentage difference between the price and a moving average, highlighting the strength of the market movement in relation to a reference value.

The Balance of Power (BOP) is an indicator originally developed by Igor Livshin in 2001 to measure the balance of power between buyers and sellers during each candle.

This is a tester script that extends the standard MetaTrader 5 optimisation capabilities, allowing you to evaluate strategies according to complex user-defined criteria (with separation into in-sample and out-of-sample periods, advanced metrics and statistical tests).

Showing different ways of the Aroon values calculation

This MQL5 indicator identifies Upward (Bullish) and Downward (Bearish) Pinbars, displayed with customizable arrows (lime for upward, red for downward). It allows fine-tuning of detection parameters like tail body ratio and protrusion. Pop-up and push notification alerts signal new pinbars. Ideal for traders seeking precise reversal pattern detection.

simple atr supertrend with rsi filter

Overlaying multiple stochastics with different periods will help beginner traders.

Allows you to easily visualize bullish and bearish periods confirmed by the zigzag indicator using vlines. You can control the display of the zigzag, choosing to start from the beginning of the chart or from a certain number of bars, as well as the display of labels showing the price of the peak or trough, the direction of the past period, and its amplitude in pips. Of course, it works on the main window as well as on sub-windows. WARNING!!! This is a valuable aid to understanding and calibrating indicators and developing strategies, but it is not intended for direct use. Translated with DeepL.com (free version)

The RSI Engine EA is a highly versatile automated trading robot for MetaTrader 5, designed to execute trades based on signals from the popular Relative Strength Index (RSI) indicator. Version 2.1 features optimized signal processing and enhanced stability. The EA provides a flexible framework with multiple RSI-based strategies, confirmation filters, and comprehensive trade management settings, making it suitable for both novice and experienced traders.

Professional Telegram Bot integration library for MetaTrader 5. Complete solution for sending trading signals, screenshots, reports, and real-time notifications to Telegram channels and groups.

Introducing MP by SPLpulse, a sophisticated and highly versatile Expert Advisor designed for the modern trader. Whether you are a scalper, a trend follower, or a reversal trader, MP by SPLpulse combines multiple trading strategies with an institutional-grade risk management suite to adapt to your unique trading style. Take control of your trading with unparalleled customization and powerful automation.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192