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

Aroon oscillator - multi time frame version

Aroon - multi time frame version

Set the number of consecutive candles along with RSI level for a valid signal.

Kalman filter - with candles or bars, multi time frame version

This is the version 2 of my script to export the trade history from MT5 selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software. More columns were added and fixed minor errors. The code for processing and exporting data was rewritten.

Kalman velocity - multi time frame version

Kalman filter - generalized version

Trix pivots

Rocket RSI pivots

Ssm RSI pivots

Simple support resistance

Simple intraday support resistance

T3 velocity tape

Detect bullish and bearish engulfing candles when entering the overbought or oversold territory. We have all seen a currency pair enter the overbought or oversold territory and stay there for long periods of time. What this indicator does is gives you the emphasis. So if you are looking for reversals then you may want to take notice when oversold territory is entered into with a bullish engulfing candle or if the trend is your thing then check for bearish engulfing candles while entering oversold.

CCI - double smoothed Wilder's EMA filtered with floating levels

CCI - double smoothed Wilder's EMA filtered

This script will export the trade history from MT5 selected between two dates. The resulting file is CSV that can be opened/imported with any spreadsheet software. Current version 1.0 does not add the takeprofit and stoploss. Any advice to improve this is welcomed.

Bollinger bands breakout

Bollinger bands - extended

Export history of deals ordered by close time from a retail hedging account to .csv file.

Simple harmonic oscillator

Simple harmonic index

Wave period oscillator

RMA - multi time frame version

M-oscillator extended


RMA average

Kalman filter velocity

Double smoothed EMA - floating levels (multi time frame)

Double smoothed EMA - floating levels

Double smoothed EMA - multi time frame version

A trading system based on custom indicator VHF.

Expert Advisor Exp_SpearmanRankCorrelation_Histogram with the added option of trading within the weekly range only, the borders of which are specified in the EA's input settings

The indicator builds graphical object Fibonacci Levels with many settings at High and Low prices over the period specified in the indicator input parameters

A trading system with a very simple neural network unit. It uses an iMA (Moving Average, MA) on H1, H4, and D1.

Searching for a daily range. We use OBJ_HLINE, OBJ_VLINE.

The script builds the Fibonacci Levels graphical object with the option of selecting the number of its segments

Indicator CandlesAutoFibo_Grand with the option of changing the number of segments in the graphical object of Fibo levels using one input parameter

An Expert Advisor based on indicators iADX (Average Directional Movement Index, ADX) and iMACD (Moving Average Convergence/Divergence, MACD)