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!

Instead of using the "regular" Heiken Ashi for oscillator calculations, this version is using the smoothed Heiken Ashi. That makes the number of false signals fall dramatically, and, when pre-smoothing is applied to Heiken Ashi, the lag is in acceptable bounds.

Instead of using "pure price" this indicator uses Heiken Ashi values to determine the trend as well as the "strength" of the trend.

This is not a directional indicator. This means that even it is stochastic it does not show the direction of the market, but shows the direction-amount-size of volatility. The assumption that seems sound enough and after which this indicator is made is that in the times of extremely low volatility it is a good time to enter the market, since the change in volatility is imminent. Those times are marked by dark gray dots on this indicator. For direction of entry, you should use some other trend showing indicator(s).

EMA Levels multi timeframe version.

Schaff Trend RSX multi timeframe version.

Schaff Trend RSI multi timeframe version.

A library for working with a third-party tick archive.

An Expert Advisor based on two iMAs (Moving Average,MA) and one iRSI (Relative Strength Index, RSI). It tracks virtual profit. Works on two symbols.

Stochastic on the price chart.

A signal indicator for opening/closing positions.

A trend signal indicator.

The indicator displays the ratio of two LSMAs.

Linear regression line (LSMA) - a moving average calculated by the linear regression method.

A Moving Average based on Heiken Ashi candlesticks.

Modified BW Zone Trading - a modified indicator of Bill Williams' zone trading.

Detrended Price Oscillator Bar - price chart without a trend.

The Expert Advisor opens no more than one position per day. Positions are opened at the specified time. It searches for the Highest and Lowest price in an interval. Data of two iMA (Moving Average, MA) indicators are used.

A colored histogram of the days of the week. Uses the drawing style DRAW_COLOR_HISTOGRAM.

An arrow indicator, which compares the daily open price with the close price of an hour.

A utility for applying trailing stop based on the "Parabolic SAR" indicator.

The Expert Advisor places pending Buy Stop and Sell Stop orders. Includes checks for the minimum distance of orders in points (SYMBOL_TRADE_STOPS_LEVEL).

Trend detection based on the last three bars.

A histogram of the days of the week.

An Expert Advisor based on two iMAs (Moving Average, MA) and one iSAR (Parabolic SAR). Position trailing.

The Expert Advisor opens positions when the price crosses line objects.

Simultaneous opening of two opposite positions. Trailing Stop.

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

VSI - Volatility Switch Indicator.

The IDayIIndex (Intraday Intensity Index) oscillator indicator.

A stochastic momentum.

A colored histogram drawn using the High/Low prices.

The indicator adds signal marks to a price chart when the CCI indicator crosses its zero line.

An indicator of the market state.

Gap searching indicator.

SZO (Sentiment Zone Oscillator) is an indicator of market sentiment, which has overbought and oversold zones.

CVI (Chartmill Value Indicator) shows the value of price deviation from the Moving Average.

Pending Buy Stop and Sell Stop orders. The EA trades in the specified time period. Determines the highest and lowest prices in the specified range of bars. Position trailing.

An Expert Advisor based on the iIchimoku (Ichimoku Kinko Hyo) indicator. Separate Stop Loss, Take Profit and Trailing Stop for BUY and SELL positions. The EA operation time is configurable. A check is performed on the current bar: only one position can be opened.

An indicator for automatic drawing of trendlines based on fractals of a given timeframe.

The EA trades using pending Buy Stop and Sell Stop orders, applying the iAMA (Adaptive Moving Average, AMA) indicator based on a "round price". Position trailing.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115