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

icon

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!

Submit your code

Moving Average Bands

Nadaraya-Watson estimator

This indicator provides handles for 2 properties, MA Speed (scaled) & Price-to-MA Distance (%)

Open Pending order After Position Get StopLoss

SymbolInfo example script lacks margin and leverage data wich are nowhere to be found explicitely in Metatrader, the trader must search thoroughly into the broker site in order to find them. The aim of this script is to provide a remedy to it from a standard tool.

This code use close all profit at end of week for currency pair

This code use detect economic calendar and put pending order before released news time

This free code manages to close all positions just by drag and drop into a chart.

This is MQL5 version of Shved Supply and Demand indicator written by Shved and upgraded by eevviill7 from this link. Subsequently Mr. Behzad Movaghar added other functionalities to this link. This version of the Indicator contains the Code with an option to select the time frame of the Indicator other than that of the chart. For example if the chart is in 5M and the user want to see the support and Resistance levels of a particular chart pair at 15 M, is possible with this.

Check exists pending order prevent duplicate create pending order

Use protect profit after open position

You can identify buy trend and sell trend with this indicator

This EA demonstrates creating and saving a graphic chart using data from the MT5 Strategy Tester.

The HighPass - LowPass Roofing Filter was created by John Ehlers (Cycle Analytics For Traders pg.78)

Use the intersection of two moving average lines to draw a vertical line.Then You can simply read the current market pattern

After the three average lines are arranged completely according to high and low, it can be regarded as a trend formation. After the pattern is destroyed, the hatching is no longer drawn Under the condition of no hatching, it is regarded as an indeterminate period

Building good trading habits by seeing things in terms of percentage not in terms of money.

Script to download EVZ data for Euro FX Vix indicator

Fibonacci Channel with Quartile Trendline Levels

The Fisher Transform Indicator was created John Ehlers "Cybernetic Analysis For Stocks And Futures".

Building good trading habits by seeing things in terms of percentage not in terms of money.

Binance API Library MT5

This is a simple script that Closes all Orders and Positions available

Shows Last Price, Daily percentage change and Time based on Input selection to the Price Line

"The Fisher Stochastic Center Of Gravity" was created by John Ehlers (УCybernetic Analysis For Stocks And FuturesФ , pg.95)

Simple class for getting the number of microseconds (µs) elapsed since January 1, 1970

& moving average , two rsi filters.

awesome oscillator, stochastic filter. expert

Volume Colored Candlestick with Bollinger Bands as the Standard Deviation

3 fibo levels.

Volatility indicator

A version of ATR adaptive smoothed Laguerre RSI that does not use any built in function

ATR adaptive smoothed Laguerre RSI 2 (extended)

Optimized ATR adaptive Laguerre RSI

trending breakout

pips in time

"The Enhanced Signal To Noise Ratio" was created by John Ehlers and published in the book "Rocket Science for Traders", pg.87-88.

Calculates Brokerage, Commission or Slippage based on the Input on the strategy Tester

The Momentum-based Adaptive Channel is a version of the adaptive channel based on the Euclidean distance. It is designed to adapt according to the dynamic market as needed.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173