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

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.

latest|best

The script allows you to try regular expressions in MetaTrader 4.

After back testing, we usually need to analyze the testing result on a new chart which we have loaded our template,in this case we need to copy the objects on the testing chart to the new chart. This script helps to save the objects into a file and show the objects on a new chart.

The script downloads history for all timeframes and symbols in the Market Watch.

This is an Expert Advisor (+ indicator) for downloading the quote history of the current symbol and TF

Displays the relative strengths of chosen currencies on one chart.

Get entry signals from specific candles based on your rules.

Displays a Histogram of Momentum, ATR, CCI or RSI indicators relative to a specified level.

This script is used to convert history data from M1 to M5, M15, M30, H1, H3, D1, W1, MN.

Generates a random number, and if this number is even, it will buy, if odd - it will sell.

RSI modified to show the excess of the market (more than 70 and less than 30), and show you the divergency with the price.

Simple one click trade panel, typically useful for scalpers and day traders.

Center of Gravity Modification 2018.

Indicator displays the value of defined stop loss and or take profit in the deposit currency.

CEquityHstBar - library for showing the equity of EA back-testing by the offline chart.

It shows the three relevant items of the online status of the terminal: connection, ping, prev_calculated and sends an email if defined.

This robot optimizes the values it uses for overbought and oversold based on what would have been profitable during the Optimization periods(bars) back. Using the strategy of selling when the index indicator crosses below overbought and buying when the index indicator crosses above oversold.

This indicator allows you to see the Moving Averages from different timeframes on the same chart. It helps you to spot the dynamic levels of support and resistance. It uses a custom window with check boxes to show/hide the different Moving Averages without need to access the indicator settings window.

Uses the analysis of 4 indicators.

Class for working with synchronization events.

Displays the number of each bar - both, relative to the most current bar and in absolute terms from the beginning of the chart.

This custom indicator will show you 28 pair's daily candle range, High-Low range, candle bullishness or bearishness from real tick market. So you can understand the overall market situation very short time. You can change the default timeframe from Daily to any period and default candle (bar) number from 0 to any previous number. Also you can open the required symbol by clicking the symbol button.

Regular expressions provide a formal language for quick and flexible processing of texts. Each regular expression is a pattern (mask), for which the regular expression engine tries to find matches in the source text. A pattern consists of one or more character literals, operators, or constructs.

Not really profitable but the code fits on one page.

Previous Candle Hi-Lo is used to check the last candle multi-timeframe position relative to the current price.

As simple Regression Channel code for MetaTrader 4.

The functions included in this template use two news sources - Investing.com and Dailyfx.com. The template doesn’t use DLL.

Shows when two or three consecutive bull or bear candles of a certain size print after qualifying the stochastic level of the initial candle in the series.

Get a grasp of the current trend by candle colors.

Indicator to trade divergence. One of 30 indicators can be selected.

A class system to represent a hidden stop loss and take profit system, combined with 4 example files showing the use of the classes.

The indicator marks the days of the week with a colored histogram in the chart sub-window.

The example of multicurrency hedging implementation on a single chart in Metatrader 4.

Expert Advisor for pyramiding into big and fast market movements.

Automatic placing of Buy Stop pending order and Sell Stop pending order simultaneously, Stop Losses and Take Profits on the user specified levels. As soon as the long position (BUY) is opened as ASK price crosses the levels, the remaining pending order (SELLSTOP) is deleted. Vice versa if the short position (SELL) is opened as BID price crosses the levels, the remaining pending order (BUYSTOP) is deleted. It places again both pending orders after the opened order has been closed.

Use Chaos Theory to trade!

The EA using single layer Perceptron.

Open two buttons on a chart, one for closing all shorts, one for closing all longs. The buttons labels display the current total profit for each type of order.

Stores and implements a basic hidden Stop Loss and Take Profit system.

Relative Strength Oscillator or RSO is an Oscillator version of RSI.

This indicator allows you to define a checklist for you to manually check and confirm your strategy before entering into a trade.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384