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

icon

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.

Submit your code

This Expert Advisor uses three indicators: MA(150), RSI(3) with the levels of 80 and 20, Stochastic(6, 3, 3) with the levels of 70 and 30. The direction of opening deals is based on MA. Entry by RSI and Stochastic. Exit by Stochastic.

The Expert Advisor reverses the orders after closing.

Opens orders using the martingale and a virtual trailing stop.

Implementation of a trading system based on divergence detection.

The Expert Advisor trades based on the support/resistance levels set by the user, while trailing the Stop Loss order.

The Expert Advisor places a grid of pending orders in both directions several minutes before the specified time and trails the Stop Loss order after the orders trigger.

The Expert Advisor is based on the "On the MaZi" strategy.

The idea behind the Expert Advisor is based on the volatility explosion in the pulse waves.

The Expert Advisor based on the "New Trading Dimensions" book by Bill Williams.

The virtual trailing stop can place stop loss, take profit and trail the order in a way that they are not visible to the broker.

Simple Expert Advisor based on the RSI indicator.

A trend strategy based on moving averages with colors as in a traffic light. The purpose of writing the EA — to test the strategy on history and pick working parameters.

The Expert Advisor watches the market orders and generates a sound signal after a predefined time from the moment of order opening.

Elementary trailing stop able to distinguish its "own" orders among others by comment and/or Magic number. It also distinguishes the financial instrument that needs to be trailed.

The Expert Advisor is based on the Williams Percent Range indicator. It sells in the overbought zone and buys in the oversold zone. Trailing Stop and operation timer are attached to it.

The Moving Average indicator values are used for trading.

This EA implements a grid strategy by placing buy and sell orders at the same time.

EA opens trades from support and resistance levels, which were set by a trader, and revolves them at another levels.

Close At Time is an EA that closes open positions or deletes pending orders or both. You can also specify how it should be closed – by symbol, magic number or ticket number.

The strategy of this EA is daily breakout which is compare previous high or low previous day candle then place a pending order for breakout.

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. Last update: 21 April 2016. Prev: 8 Dec 2015

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.

1...5678910111213141516171819...29