Download MetaTrader 5
New trading robots and indicators in the Code Base

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 Codes of Expert Advisors for MetaTrader 4

Various applications to automate analysis and trading are available in the 'Expert Advisors' section. It features various applications based on different trading algorithms and provides different degrees of automation. You can find simple EAs and complex trading robots that can fully automate analysis and trading processes.

These applications can be downloaded and run in MetaTrader 4. It is recommended to test and optimize Expert Advisors in the Strategy tester. The Expert Advisors from the library can be accessed from the MetaTrader 4 platform and the MetaEditor development environment.


This program is a basic version of the original code of relatively simple system Millenium.

This is a working singleton code example. A singleton object is created when there 'can be only one' of the object.

Copying utility with minimal functionality.

EA opens trades from support and resistance levels which were set by a trader.

This EA will help you to set Stop Loss and Take Profit.

The EA looks for trend using three MAs (period 200, 50, 25 or other) and opens orders using the Parabolic SAR indicator. There is martingale in an Expert Advisor, the lot is calculated in percents from a deposit depending on Stop Loss.

Instant execution button to close profit orders, close all orders, auto close by trailing parameter.

A robust EA template to use with your entry conditions.

Easy EA for closing positions of the symbol with profit or loss. You can use it for hidden SL too.

An EA template to add a simple trailing stop to your strategy.

This an H1 strategy. This EA will execute at the new bar if the last bar has broken through the point that we set.

This EA will show the button that can used to close all orders by the current chart symbol.

RSI EA based on overbought and oversold levels.

Personal Assistant The Next Generation is there to make your trading easy, basically it does what a real assistant does — provides information and executes your orders.

Personal assistant is there to provide you with crucial information for making investment decisions and to execute your orders.

This Expert Advisor trades on the principle of the Martingale: if the order is closed by Stop Loss, the next order will be the opposite type with a lot size increased by a certain rate.

Expert Advisor I have developed for News Time Trading (set time and leave it).

This Expert Advisor places Stop Loss and Take Profit for Buy, Sell, Buy Limit, Buy Stop, Sell Limit and Sell Stop orders.

Simple EA template to export trade details from a backtest or live trading to a CSV file.

Expert Advisor based on JJN Scalper indicator.

This is a simple multistrategies EA based on many strategies that work in parallel mode.

Expert Advisor with the system is very sensitive to movement.

This EA is based on 1 moving average indicator, the exit and entry points are determined by a "smoothing factor".

FMOneEA is a scalping Expert Advisor based on MA and MACD indicators.

When the current price is below trendlines, EA will wait for upward breakout, and vice versa.

The Expert Advisor closes all positions if equity exceeds specified percent from balance.

It's a hedging Expert Advisor, which trades only one time per day.

EA for Automatic StopLoss, Take Profit, Profit Lock, and Trailing Stop. SL and TP could be hidden.

CSPA is a multi currency Expert Advisor, it uses the currency strengths to open trades on the best pairs.

MPM is a stop reverse strategy.

Syndicate Trader is coded from the basic VSA (Volume Spread Analysis) study by Wyckoff.

New version of KNUX Expert Advisor. The strategy works with martingale.

The Expert Advisor can be used for Trailing and hidden Take Profit/Stop Loss.

This Expert Advisor is based on one of 17 Proven Currency Strategies by Mario Singh.

Order_EA is a simple visual oriented program that uses drag & drop scripts to control order processing.

Hybrid Scalper is the Expert Advisor based on many indicators.

TrendCollector is the EA based on price action, Stochastic indicator, specific EMA's (206) crossings, and trade size variability based on ATR and time of a day.

This Expert Advisor is based on Murrey lines, Stochastic Oscillator, Bollinger Bands and Candles.

The EA manages open position with a user defined Trailing Stop.

This EA automatically sets preconfigured Stop Loss and Take Profit value on all orders with empty TP & SL.