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

MQL4 Source Codes of Technical Indicators for MetaTrader 4 - 2

icon

The library of technical indicators for MetaTrader 4 developed in MQL4. Regardless of the market (forex, securities or commodity market), indicators help to represent quotes in an accessible form for easy perception.

This section contains thousands of applications that analyze financial markets using different algorithms. Conventionally, they can be divided into a few categories: trend indicators, oscillators, volume indicators and so on. In addition, there are sets of indicators based on algorithms by famous financiers. For example, Bill Williams' indicators and likes of it. All of them are characterized by different parameters of reliability, efficiency, lagging and others. There are more than 2000 indicators for technical analysis: trend indicators, reversal indicators, indicators of levels, predictors, scalping indicators and many others.

Submit your code

BB MACD MetaTrader indicator — is a basic MACD (Moving Average Convergence Divergence) indicator variation, which helps in detecting the trend change points and measuring the current trend's strength. The indicator is drawn in the separate window on the chart and consists of two lines (blue and red) and the dots, which can be either green or magenta. The change of the dots' color is a good signal provider, while the width of gap between the two lines indicates the strength of the current trend. This indicator is available for MT4 and MT5.

Basing Candlesticks MetaTrader indicator — is an automatic indicator that detects and marks basing candles on the chart. A basing candle is a candle with body length less than 50% of its high-low range. The indicator highlights the basing candles using histogram lines (in MT4) or custom candles (in MT5) directly in the main chart of the platform. The percentage criterion can be changed via input parameters. You can also turn on alerts for when a new basing candle appears.

Aroon Up & Down MetaTrader indicator — detecting the local tops and bottoms of the chart it was applied to, this indicator provides the signals for buying and selling the currency pairs when they rise up from the bottom and fall from the top. The cross of the indicator lines provide a good signal to take the profit or to exit with a minimum loss. This indicator can send sound and e-mail alerts on the cross. It is available in both MT4 and MT5 versions.

3rd Generation Moving Average is an advanced version of the standard moving average (MA) indicator for MetaTrader. It implements a rather simple lag-reducing procedure based on the longer MA period. The method was first described by M. Duerschner in his article Gleitende Durchschnitte 3.0 (in German). The presented version uses λ = 2, which provides the best possible lag-reducing. Higher λ increases similarity with the classic moving average. The indicator is available for both MT4 and MT5. It does not require using any DLL

Breakeven Line Indicator is a MetaTrader indicator that calculates breakeven level based on all open positions and displays it on your chart as a horizontal line. Additionally, it will calculate the total number trades, the total number of lots, and the distance to the breakeven line in points and profit/loss. The indicator is available for both MT4 and MT5.

Negative Volume Index (NVI) is a free technical indicator for advanced chart analysis in MT4, MT5 platforms. It is based on tick volume (can be substituted with real volume in MT5) and has two useful features added:

Candle Range MetaTrader indicator — is a very simple and lightweight indicator that displays the candle's range in pips on mouseover. In addition, to the High/Low range, it can optionally display the body size (Open/Close) for candles. Multiple display parameters are available to control how the indicator looks. This indicator is available for both MT4 and MT5 versions of the trading platform.

The indicator shows the names of the days of the week as text labels on the chart.

Moving average with calculated period based on timeframe

ZigZag with automatic step size detection for changing wave direction.

Another version of ZigZag, where the step size for changing the direction of the segment is set in price points.

Double ZigZag draws virtual Buy and Sell levels on the price chart.

The indicator draws the nearest levels of the specified price range.

The same PNB from Yousufkhodja Sultonov.

The indicator displays the actual range of the hourly candle in percent and the calculated range based on average statistics.

The indicator searches for candles on the price chart that are larger than the size specified in the settings and marks them on the chart.

The Trend Strength Index indicator measures strength of current trend.

change of MA curve to horizontal line and DPO curve shall represent the distance from close price to zero level (or MA curve)

Linear Regression Value (metatrader 4 version)

a very convenient way to filter out unnecessary signals of crossing levels

improved version of the standard Simple moving average indicator with a lower delay based on: https://www.mql5.com/en/code/30844 (author: https://www.mql5.com/en/users/mladen)

standart RSI with dynamic levels

Changing the size of the chart window is important in my EA, but it may serve as inspiration for others.

Simple banner showing Symbol Spread Equity Profit Banner

This is an indicator to calculate 14 types of moving averages based on close price.

This is a indicator to plot hidden and regular divergences on chart.

AVA adapts its analysis based on current market dynamics. This adaptability makes it invaluable for predicting shifts towards higher volatility or calmer periods.

Displays the gains and losses for all candles where the given threshold is surpassed. The values are calculated in points and percentage.

mt4 version of original indicator

SSH is popular indicator as it uses simply two moving averages. This version is a mylti-TF of SSH with TF change ability from screen.

This is the exact conversion of pivotshigh and pivotslow functions from pine script v4 as an mql4 indicator.

A simpler way to display Heikin Ashi

The purpose of this indicator is to demonstrate newbie friendly way a structure of a multi time frame indicator based on recursion.

Few improvements from standart fractal: 1. You can chouse size of fractal. Standart version use 2 as constant 2. It does not draw fractals against the trend, which makes your chart much more informative

Show MACD directly on chart

Donchian Channel with mid line and moving average of mid line. Updated Dec 6, 2023 Minor code update

The Oscillator Indicator for MetaTrader 4 is a powerful tool that accurately identifies the perfect signal on the completion of trends.

A combination of data analysis from the Awesome Oscillator and the resulting direction of the candles relative to the previous range

This is an indicator with a rainbow-like display, both for trend or pullback prediction.

Simple Support, Resistance, and Mid-Line boilerplate

123456789...63