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

MQL5 Source Code Library for MetaTrader 5 - 9

This is the largest free source code library for MetaTrader 5 platform programs. Here you can find ready-made Expert Advisors, technical indicators, scripts and libraries. Use the code library when learning MQL5 language and develop your own automated trading applications based on the provided codes.

You can freely download and test published codes, as well as launch them in MetaTrader 5. The library is also available directly from MetaTrader 5 platform and MetaEditor development environment.

To post a new code, please log in or register
latest|best

RSI with on chart SR levels

CCI with on chart support and resistance levels

Corrected double smoothed Wilder's EMA (extended version)

Corrected double smoothed Wilder's EMA

TRIX using Wilder's double smoothed EMA - with an addition of floating levels

TRIX (using double smoothed Wilder's EMA)

Very handy Multiple Moving Averages for those who like to look at Price Action using several time periods...

Pretty simple. Seems Stupid. But yes, You need this...

RSI of average using double smoothed Wilder's EMA

RSI with double smoothed Wilders EMA

A very simple, efficient and non-obtrusive clock for your Chart. KISS compliant! :)

Double smoothed Wilders EMA

TRIX (using fast EMA for calculation)

MACD of RSI adaptive EMA - with floating levels

RSI adaptive double smoothed EMA

Phase accumulation adaptive market mode - discontinues signal lines

Phase accumulation adaptive market mode

Phase accumulation adaptive bandpass filter

Zero mean normalized nonlinear Kalman filter - with floating levels

Zero mean normalized nonlinear Kalman filter

Nonlinear Kalman filter - floating levels

This is a working singleton code example. The sole purpose of this post is to provide a working code sample of a singleton object. A singleton object is created when there 'can be only one' of the object. This is accomplished by making an object's constructor private, and ensuring assignment and copy operations are also private. I was working on an EA and identified that an object should never have more than one copy. I don't expect the EA to ever get large enough for it to actually matter that a singleton is used, but I like the clarity in the code for the object's type. The code follows closely the tutorial at http://www.yolinux.com/TUTORIALS/C++Singleton.html.

Averages crosses

Heiken ashi - histogram

Market mode - discontinued signal lines

Market mode

Bandpass filter

The Bigger Time Frame Bollinger Bands indicator

The Three Bigger Time Frame ATR indicator

Three ATR Bands with multiple selection

The Donchian Oscillator indicator

The Multi-timeframe Moving Average indicator

The Expert Advisor uses Buy Stop and Sell Stop pending orders. Martingale.

The AutoFibAutoTrend indicator, in which you can change colors and the values of horizontal Fibo levels.

Two identical trading systems (for long and short deals) based on the ColorMaRsi-Trigger indicator signals that can be configured in different ways within a single EA with an ability to change the volume of a forthcoming trade depending on the results of the previous trades for this trading system.

The Multi timeframe Elder's Safe Zone indicator

The ColorRSI_X20 indicator with the possibility to change the calculation timeframe using the indicator input parameters

The ColorMFI_X20 indicator with the possibility to change the calculation timeframe using the indicator input parameters

The Expert Advisor uses Buy Stop and Sell Stop pending orders.

The XFisher_org_v1_Vol_Supr_Zer indicator with the possibility to change the indicator timeframe using input parameters

12345678910111213141516...168