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

The indicator determines the index of the direction of the bar prices and the Gap/breaks in them. It is a logical continuation of the ms-Candle indicator.

Dual differentiator adaptive EMA

Dual differentiator

MACD with on-chart SR levels

Smoothed WPR with floating levels and on chart support / resistance levels

Smoothed WPR with floating levels

Smoothed Williams percent range

Long Short-Term Memory Neural Network - for time series analysis.

Trix oscillator with support / resistance lines on chart

Stochastic with support / resistance levels

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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160