Download MetaTrader 5

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 - 64

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.


The strategy is based on Moving Average with the periods of 5/20/40/60.

The indicator shows the trend on a daily chart(2) using indicator ZIGZAG-FRACTALS. It also shows the enter price for HIGH/LOW of the preceding bar on the current timeframe.

A fast oscillatorб also suited for scalping.

The indicator shows support/resistance levels calculated using the methods by V.B. Antonov (A_Vlad).

A system based on "round" numbers.

One more interpretation of the well-known ZigZag. The indicator is written to work according the trading system described here: The indicator works with ZigZag by Rosh (Zigzag2_R_).

A trading strategy that works with short-term trends.

This is an EA that increases the lot size after each profitable trade if it follows some losing trades.

A realization of the method described at The author of the realization is not the author of the method, so I don't vouch for the realization correctness.

The indicator prints net positions for all currencies in the screen. This is a monitor of a multicurrency portfolio.

This indicator has already been placed here. This given modification is more visual.

Indicator OSC-MTF_CF_SYS-v1.1

Indicator Squize_MA.

Simple indicator BBflat_sw.

The indicator displays helpful information for the trader.

It draws a channel with recommendations.

Indicators Parabolic SAR and Exponential Moving Average are used in the system.

Indicator Impulse CD (Color) is a sequel of impulse approach. By users' requests, colors and signal line are added.

A toy script that demonstrate the way of displaying some text information in a chart.

The script draws a set of up/down levels that are at a certain-percentage distance from the price of the bar selected by user.

A script aimed at loading of history for all available currency pairs, metals, indexes, CFD, and at checking of history for "holes".

The script places stop orders. The orders are placed for the market/pending orders specified in custom variables High (variable Hi) and Low (variable Lo).

System OzFx to gain the profit of 100-800+ pips.

The system is based on volatility compression.

Three scripts for quick preparation and manual placing of trade orders.

A multi-currency Expert Advisors aimed at trading on Asian sessions.

An EA that increases the order volume after each losing trade.

An example of using graphical object OBJ_LABEL for tabular display.

A code/method to test the redrawing indicators, by the example of FxmFish

High-Probability Breakout EA with very favorable risk:reward ratio.

The strategy underlying this EA is based on the indicator of MA.

This automated trading system is intended for working with the currency pair of eur/usd in the one-hour chart. Excellent results.

The EA is based on the indicator TREND_alexcud Something goes wrong with it

Indicator RoundLevels draws two "round" nearest levels above and below the current price level. Short English comments are in the MQ4 file.

I modified the original MACD. This resulted in such an interesting indicator.

Indicator StochCandles. Paints candles on the basis of stochastic.

Indicator Stoch Crossing is a modification of EMA-Crossover_Signal based on Stochastic Oscillator.

Indicator Traders Dynamic Index, helps traders to supervise the market.

Indicator MTF_4TF_Supertrend_BarM. Works together with SuperTrend and uses signals CCI.

Percentage Price Oscillator displays more precise signals of divergences between prices and the value of the oscillator. It also emphasizes price extremums more precisely, it moves faster.