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

Two identical trading systems (for long and short positions) based on the signals of the FineTuningMACandle indicator, which can be configured in different ways within one Expert Advisor

The Expert Advisor combines signals from several indicators. It can also follow a certain indicator.

The indicator shows the gap size on the histogram.

XFisher_org_v2_Candle indicator provides alerts, sends email and push notifications at the incoming trading signals. Possible signal options

The Expert Advisor uses iMA (Moving Average, MA), iAO (Awesome Oscillator, AO) and custom Laguerre indicators.

XFisher_org_v2_Candle_Alert indicator with background filling for overbought/oversold areas, as well as for the channel between them

Exp_XFisher_org_v1 Expert Advisor based on XFisher_org_v1 oscillator signals.

Working by iMA (Moving Average, MA) and OHLC of W1 timeframe

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

Candle Range Envelop indicator

Mean Indicator indicator

Now you can test the indicator and select the price type from the ENUM_APPLIED_PRICE enumeration

Slope Direction Line / Moving Average confirmation candles indicator

Slope Direction Line / Moving Average confirmation bars indicator

The indicator plots one vertical line per day in a specified moment of time

RSI_X20 indicator is able to color each line depending on its position relative to overbought and oversold areas

The indicator plots support/resistance levels and areas

ATRStops_v1 indicator in the candle form

ADX Fractal Signals indicator

Bollinger Bands Outside Candle Alert indicator

RSICloud indicator with background filling for overbought/oversold areas, as well as for the channel between them

Day of week indicator

Ehler's Center of Gravity indicator

Elder's Safe Zone indicator

Elder's Safe Zone Triple indicator

Highly Adaptable Moving Average Alert indicator

T3 Price Overlay indicator

Multiple strategies within a single Expert Advisor. When two or more strategies are activated, a position lot is increased exponentially.

A simple indicator that calculates rounded volatility of a financial asset. Volatility is calculated in points based on the maximum and minimum prices

The indicator based on two indicator buffers (DRAW_LINE style)

Volatility2Step indicator provides alerts, sends email and push notifications when the indicator breaks through the trigger level specified in the inputs.

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

The EA applies WPR Custom indicator.

iWPR (Williams’ Percent Range, %R) indicator features new settings allowing users to manage display of levels and main level color from an Expert Advisor.

The Expert Advisor counts the number of bullish and bearish bars in a row.

The indicator paints a candle in color corresponding to its direction once per day at a specified time

The indicator plots one vertical line per day in a specified moment of time

Consensus of Five indicator

Twenty RSI indicators in a single window.

The Expert Advisor applies iMA (Moving Average, MA), iRSI (Relative Strength Index, RSI) and Silence indicators. Martingale.