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 Source Code Library for MetaTrader 4 - 5


The largest library features codes of free trading Expert Advisors, technical indicators and scripts. With the available applications you can trade in automated mode and analyze price dynamics. Use the library of codes to learn more about financial market sentiments.

Download free applications, test them and run in your MetaTrader 4. You can access them from the MetaTrader 4 platform and the MetaEditor development environment.

Submit your code

Displays the current timeframe and symbol name in large font on the chart background. Useful when hopping between several charts with different symbols at the same time.

The script is best use to clean up all drawings ( Delete All Object, Comment, horizontal line, vertical line, arrows etc) on current chart. Please feel free to modify based on your needs.

Dynamic pivots - any time frame

It's an expert to open and close orders on specific day and time. Expert open and close orders only with the same symbol it attached.

Limit channels - with states - metatrader 4 version

Show Orders History On Chart

ATR based limit channels - metatrader 4 version


Directional Movement using Hann windowing - metatrader 4 version

This Is Just A Normal Trailing Step Function.

This Is a Normal Trailing Function For All Open Order In MT4.


MyRsi with Noise Elimination Technology - by John Ehlers : metatrader 4 version

MyRsi - by John Ehlers : metatrader 4 version

A script that displays MarketInfo and SymbolInfo data through a button list built from MarketWatch.

Two RSI indicator periods smoothed and displayed as histogram.

Nadaraya-Watson estimator - metatrader 4 version

An optimized version of the Zigzag indicator, which was included in the MT4 delivery of 2005 (and in MT3.83).

Read news from forex factory website by web request

G channel is a channel indicator with 3 lines- a middle line representing a central tendency and 2 Upper and Lower boundaries calculated based on the past values of same indicator. Its based on the paper "Recursive Bands - A New Indicator For Technical Analysis" by Alex Grover and is a code conversion from TradingView. The channel breakout of Upper or Lower boundaries represent a new trend or trend continuation while narrowing of bands represents ranging or low volatility conditions. The channel can prove to be a good indicator of a trend direction and also a guide for trailing of stop loss. It has only 2 variables. Channel period - default set to 100. Price type.

Use trailing stop point with MT4

ATR with 4 smoothing options : RMA, EMA, WMA, SMA

Sharing this trend indicator made by me. Called "Timeframe Flow". It will draw a user defined higher time-frame candle on every shift on your current time-frame. Meaning you can have H4, H12 or D1 candles on every shift of your H1 Charts. Or you can have D2, D3 or D5 candles on every shift of your Daily Charts. Combined with the current time-frame ATR Bands, you have a trend indicator with some filter. You may also use the Mid Line crosses as exit( Calculated using Higher timeframe candles displayed in the indicator(Close + Open)/2 ).

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

Determines when market price is smooth or rough

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

Custom Function To Get Comma Separated Things From String.

This Custom Function Will Help To Get Round Time For Any Given Timeframe And Time.

Displays direction of volatility and volume

Turn your losing trade into winning trade with Zone Recovery Hedge

This indicator is used for identifying extrema of different degrees.

Indicador Mass Index para Metatrader 4 con los niveles más importantes en donde se producen las señales de este indicador, de acuerdo a su autor. El MI es un indicador basado en la volatilidad del mercado.

Indicador de medias móviles Hull (HMA) para Metatrader 4 que cambia de color dependiendo de la tendencia. La HMA es una media móvil diseñada para seguir de cerca la acción del precio más reciente pero sin perder el efecto de suavizado. Puede resultar muy útil para el análisis de tendencias.

Candle cross either of three lines.

Have you ever wanted to add another trade only after the previous has been modified by either trailing stop or even break even , This code will help you to be able to implement that

Volatility indicator

trending breakout

candle pattern

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.