Download MetaTrader 5

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!

Strategy: N bars up and one bar down. Trailing. Lot calculation based on the risk value as a percentage of free margin.

Intraday volatility breakthrough system. The Parabolic SAR indicator is used.

A trade strategy based on the RSI indicator. Checks if there is enough money before opening a position.

The ColorParabolic semaphore signal indicator featuring alerts, sending emails and push notifications.

A trend indicator SSL, marking trend change moments using colored icons, with the possibility to generate alerts, send emails and push-notifications.

A trading system using the SSL indicator.

The SSL indicator with the timeframe selection option available in input parameters

This indicator colors candlesticks in different colors depending on the strength and direction of the trend, using Keltner channels

The EA uses two Moving Averages, one MACD and one CCI. OnTradeTransaction is used to receive position opening time.

The ColorXWPR_Histogram indicator with the timeframe selection option available in the input parameters.

A trend indicator VTS using the Keltner channel.

A trend indicator VTS using Bollinger Bands.

Averaging of values (RSI) using MovingAverages.mqh. Two MA indicators.

The JuiceZ indicator with the timeframe selection option available in the input parameters.

An Expert Advisor based on the "RPoint" indicator. The chart layout in X-points reversal. A high-quality ZigZag based on HiLo.

A module of trading signals based on the Moving Average indicator signal module.

The "Nevalyashka" Expert Advisor.

The implementation of the MACD pattern "Trend continuation".

A multi-currency Expert Advisor that opens a market position at the user defined time.

The Expert Advisor trades based on the ADX Wilder and Ichimoku Kinko Hyo indicators. Lot is calculated based on risk percentage of margin.

The ColorXCCI_Histogram indicator with the timeframe selection option available in the input parameters.

Trend indicator.

Trailing, pending orders. Signals of two indicators (Moving Average, MA). Trades only during a certain period of the day.

Trade direction is chosen based on a random number generator. Stop Loss and Take Profit are set based on the random number generator. Lot calculation based on the risk value as a percentage of free margin. The code contains protection against the "not enough money" error.

The smoothed StrangeIndicator oscillator with the color indication of overbought/oversold level breakouts and of the histogram direction.

The SuperSR6 indicator with the timeframe selection option available in input parameters.

Intersection of two Moving Averages. Take Profit and Stop Loss levels are virtual.

Trading system based on the signals of the ICHI_OSC indicator

A simple trend indicator of the NRTR type that uses the breakout of a channel drawn based on the Moving Averages of the High and Low price series.

The ColorXMFI_Histogram indicator with the timeframe selection option available in the input parameters.

The ColorXRSI_Histogram indicator with the timeframe selection option available in the input parameters.

Lot calculation based on the risk value as a percentage of free margin.

Trading system based on the signals of the ThreeCandles indicator

The indicator calculates OHLC crossovers

The ColorXDeMarker_Histogram indicator with the timeframe selection option available in the input parameters.

The indicator receives trade signals from the MACD histogram.

The Exp_IBS_RSI_CCI_v4_X2 trend-following trading system is based on the signals of two IBS_RSI_CCI_v4 indicators.

The ColorSTD_Histogram indicator with the timeframe selection option available in the input parameters.

An indicator of financial asset volatility using the OSMA oscillator.

The Exp_XOSignal_ReOpen trading system based on the signals of the XOSignal indicator with trend following scaling

12345678...98