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

Top MQL4 and MQL5 source codes based on user ratings - 16

Submit your code

Sample code to count consecutive no. of bull or bear bars.

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: Support for multi-timeframe (MTF) operation. Can be switched to show Positive Volume Index.

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.

Coppock MetaTrader indicator — is an implementation of the famous Coppock curve indicator first created by Edward Coppock in 1962. The indicator shows long-term buy and sell opportunities (classically, it is used for only buying) by measuring the weighted moving average (with a period of 10) of the sum of two rates of change (with a period of 14 and 11). It is the classical version. In this MetaTrader version, you can modify the parameters of the basic indicators. You can use this Coppock indicator in MT4 and MT5.

Schaff Trend Cycle (MetaTrader indicator) — is a cyclical oscillator created by calculating the stochastic over stochastic over a MACD line using cycles. The result is the improved version of the oscillator that is not choppy during the trends and reacts to the changes very fast. It was developed by Doug Schaff, who assumed that the currency trends accelerate and decelerate in cycles. Its algorithm was made public in 2008. Schaff Trend Cycle tries to combine two different methods of determining the trend direction changes — MACD and smoothed stochastic oscillator. The value of the indicator fluctuates between 0 and 100. Two trigger levels are used — 25 and 75. Optional alerts are available. You can download this indicator for MT4, MT5

The TradeReportExporter script is designed to export the history of trades (trades) into a convenient CSV file. It automatically collects data on all trades for the last year for the instrument it is installed on. The file includes such data as date and time, transaction type (buy/sell), price, volume, commission and profit/loss. The result is saved in a file that can be opened in Excel or any other spreadsheet editor.

This indicator picks up the divergence points of the DeMarker indicator

This is a simple analytical (non-signal, one-time calculated) indicator that allows you to test the hypothesis that price timeseries represent a "random walk", specifically Gaussian "random walk". This can help to construct a parametric transformation of price increments into evenly distributed, more stable and predictable time series, at least in terms of volatility.

try to imitate trading system using expert advisor

This indicator is based on DRAW_FILLING buffers. The input parameters are absent, the TimeTradeServer(), TimeGMT() functions are used.

A non-invasive candle time that can be positioned next to price or near a corner.

The Binary Wave returns a positive or a negative value depending on how the indicator readings are interpreted.

Class for the calculation of the ENUM_STATISTICS enumeration parameters

An indicator of technical shapes by Merrill. М & W Wave Patterns by A. Merrill.

Indicator to display existent and emerging harmonic chart patterns.

The Mass Index is developed to catch the trend reversal points. It is based on changes between maximum and minimum prices. If the amplitude gets wider, the mass index grows; if it gets narrower, the index gets smaller. The mass index was created by Donald Dorcy.

Classes for working with databases through ODBC and OLE DB interfaces

One-click trading.

A class for creation and output of BMP images.

The Roulette Game.

Premier Stochastic Oscillator - Double EMA smoothing of stochastic, based on article in TASC by Lee Leibfarth (August 2008)

Crossover of overbought/oversold levels of Chande Momentum Oscillator is used as a signal to open positions.

Trading signals module for MQL5 Wizard. SuperTrend indicator's color dot serves as a market entry signal.

Graphical control for pixel drawing.

The class allows to organize the mini time series, indicator minibuffers, short sized buffers to store intermediate stream data inside the Expert Advisor or indicator.

The module for tracking open positions based on Delta ZigZag for MQL5 Wizard.

Plots up/down buffer arrows in chart window.

QWMA - "quadratic weighet moving average" new generation

Support ressitance - Barry (extended version).

Forex indicator for MetaTrader 5 with show double line of linear regression with position degrees and trend alerts.

The indicator finds fractals of any dimension.

MqlParams container class that uses method chaining to quickly add params and reduce lines of code.

A library for creating analog clocks using MetaTrader 4/5 graphical resources.

A library for common rounding methods used in MQL development, primitive wrapper class for type (double), and vector for CDouble objects. MQL5 and MQL4 compatible!

Libraries based on the article "Random decision forest in reinforcement learning"

Volume Profile + Range v6.0 (former TPO).

A base class to simplify analyzing trade transactions in MQL5.

This utility is not a trading information utility. It will only have value for those getting information on the Number of Bars that have terminal data. This utility uses the functions SeriesIntegerInfo and CopyRates to obtain and display information about the availability of bar information from the terminal.

The Indicator Ichimoku Kinko Hyo is predefined to characterize the market Trend, Support and Resistance Levels, and to generate signals of buying and selling.

Sometimes this is useful - to observe the behavior of the oscillator in the channel. Greatly simplifies the evaluation of the situation.

1...91011121314151617181920212223...191