Watch how to download trading robots for free

Find us on Facebook!
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

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!

To post a new code, please log in or register

Three Moving Averages Convergence/Divergence - Indicator for MT5

Export tool for OHLC prices, calculated prices & indicator buffers

Multi-asset cluster indicator taking all currencies as a sum of squares forming market unity (1.0)

This indicator shows average and peak speeds of price changes per minute.

Improved version based on RSI_candles by © mladen 2018 https://www.mql5.com/en/code/20968

Smoothed CCI

Random number generation using the 32-bit PCG generator.

Advisor for trading Gbp/Chf. Algorithm for bar opening prices. Timeframe H1.

This indi will draw OBJ_ARROW_BUY/OBJ_ARROW_SELL when find signals on Arrow Indi Buffers.

A fast library for combinations and permutations in MQL.

The script exports summary of closed trades grouped by each trading day to .csv file

Variance (Welford’s method for computing)

The script exports summary of closed trades grouped by each currency pair to .csv file

A script to close all market positions and/or pending orders.

This script will change the SL and TP of all open trades of the symbol to the price where the script is dropped off.

Sell Relative Strengt Index (SRSI)

Average true range

BB stops of MACD with multiple stops

XO

Hull moving average

The Expert Advisor uses four iMA (Moving Average, MA) indicators from two timeframes. Two indicators with averaging periods 1 and 8 are created on the H1 timeframe and two indicators with averaging periods 1 and 8 are also created on the H4 timeframe.

A class to reconstruct closed trades (paired in/out deals) from history sorted by close time.

Display interactive HTML graph of the account balance inside the web browser.

Builds a sliding line with a polynomial of 4 degrees. Extrapolates as a section of a given function with a sinusoid and its axial one. One value is taken from the constructed lines on each bar and a line of extrapolated values is plotted, which does not redraw.

A cross platform library/framework

Exponential moving average

Linear Weighted Moving Average

Advisor scalper. Trading algorithm: Candle[0]> Candle[1] * 2. Taimeframe - 4H && Day.

Simple moving average

Vortex 2

A base class to simplify analyzing trade transactions in MQL5.

This indicator uses the open price for the day, and computes the percent change for that day. Use on any chart TF up to and including D1.

Average trend

RSI of parabolic SAR

RSI with CCI for confitrmation

Corrected AMA

Parabolic SAR of average

Buffer-free indicator implemented on iCanvas

Intra-day Keltner channel extended

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165