Watch how to download trading robots for free
Find us on Twitter!
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 - 71


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

Simple EA to Close Orders

Scripts to Close Orders under various conditions

My first EA.

The indicator that shows the direction of the trend on all timeframes in one window of the chart.

The EA for H4, it's shooted in for GBPUSD. It works with pending orders. It makes decisions by the simple combinations of candlesticks. The feature is the decision is made once in four hours and the SL and TP levels are placed in accordance with the the s

EA with a neuro net (a net with error back propagation). These are the firsts steps. I upload it for the intelligent criticism.

It displays the current time position in relation to the beginning and the end of the bar. In addition the ratio between the time passed since the beginning of the bar and the whole bar duration expressed in percents is given. The informer is useful for c

It is based on the RSI indicator.

Automatic Trading System

Stochastic net for the the classification problems with the instruction provided.

Have audio output of latest price in stereo! Revised to cater for fractional pips as now offered by some brokers to MT4.

Indicator Supertrend. It displays the buying and selling with the colors.

The trading technique that is based on the support/resistance that are determined at the daily opening.

You pick the script and drag it on a chart's point. Then it uses this point to modify all stop/take profit levels of the chart's currency.

Automatic Trading System

This indicator plots in the chart base on the tick price , ie. when the price moves down 10 pips it plots the down candle and wait till the next 10 pips if move up 10 pips it plots the up candle with the other color candle to indicate the up down price

The MUV indicator created by Sator is used.

This version of ZigZag can simultaneously display three zigzags both drawn on the data from the current timeframe and on the data from the larger timeframes.

The script is the calculator of the simple, complex, nominal and continuously charged percents.

Standard OsMA indicator with the indication of the possible trade signals.

An example of automatic running of the script when the timeframe or symbol is changed.

Two orders are placed at the specific time.

Smoothed RSI indicator with the sound signalling of crossing the level 50.

We place the pending orders at the support and resistance levels.

The automatic calculation of the lot size from the specified percent of free assests.

A "cover" for the normalization of the indicator values.

MM Lines are drawn where support and resistance is.

I added audible alerts so that when a strong buy or strong sell signal it can generate alerts when the "SoundOn" input variable is set to true.

The application of Lagrange's interpolation polynomial at FOREX.

This indicator signal buys and sell in the market.

The calculation of the amount of lots considering the possible loss. The maximum loss volume is specified in percents of the current balance.

A library of MySQL 5.0 error codes If you use a connection to the MySQL database in your EA, indicator or script and it doesn't work or something goes wrong then this library will allow you to find out what error is returned by the MySQL database.

A variation on the Neuro nets topic: The trading system based on the interaction of the MACD indicator and a double-layer neuro net.

The EA is based on the "Trend Follower" strategy.

Larry Williams indicator. It considers the influence of the secondary market on the trading market.

The indicator shows the difference between Open[0] and Close[1].