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

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

The Smart tunnel is a smart robot for trading with an automatically drawn trend line to act with it and market movement. Enjoy :)

Global Variables , Press function key "F3" Change "GMT_Time_Diff" : Diff. Eastern Time with Local Time "_ParaSL_SL" : Stop Loss Pips "_ParaSL_TP" : Take Profit Pips "_Para_Diff" : Retrace Entry , Pips with Parabolic Sar Value Remark : Limit Sell ; Bid Price with Parabolic Sars Value Limit Buy ; Ask Price with Parabolic Sars Value "_Para_lots" : Lots

OCO_EA.mq4 Copyright 2018, Speed Technology Copyright 2011, Trade Pro Company Write By Raymond (Hong Kong) OCO Order on MetaTrader4 Platform (Absolute Free) MT4 (One cancels the other) One pip Limit Order One Pip Stop Order

"Trend Finder" EA Trades when there is a breakout from historical minimum/maximum has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

"Engulfing" EA Trades when there is an ENGULFING pattern has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

"Ichimoku Rretracement" EA Trades when there is a retracement from "ICHIMOKU" levels has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

"Pull Back" EA Trades when there is a pull back from the trend of 2 Moving Averages has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

"Donchain Channel" EA Trades when there is a retracement from "DONCHAIN CHANNEL" levels has Trailing Stop Loss works on all time frames major forex pairs and stocks NASDAQ.

"Bolinger Band Squeeze" EA Trades when there is an expansion after contraction of bollinger bands has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

"Pinbar" EA Trades when there is a PINBAR pattern,has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

"Fibonacci" EA Trades when there is a retracement from "FIBONACCI" levels has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

Rsi & Cci Divergence EA Trades when there is a divergence of "RSI" or "CCI" indicator has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

This EA uses "Renko" box size on MetaTrader 4 chart. When the price reaches the level where there was a fractal, the EA enters a trade, has Trailing Stop Loss &Take Profit works on all time frames major forex pairs and stocks NASDAQ.

EA purposes to always win with cumulative profit and to manage volume.

A martingale strategy, an old EA that was rebuilt to be efficient.

EA is run say once every minute and writes the status of IsConnected, spread, stop and freeze level to a file.

This Martingale EA trades with one moving average, it is considered relatively safe because it takes a single trade at a time.

This is my version of Zone Recovery Hedging Strategy Ea with two moving averages. It works on any time frame, you should try it on demo account.

Close all positions on a basket of currencies when the profit target has been reached.

MT4 Expert Advisor based on ADX indicator.

Expert Advisor which trades signals from MACD indicator.

This is a not big assistant for trading with limit orders.

Simple program using the moving average as bias and providing many trade and money management options.

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

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

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

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.

Uses the analysis of 4 indicators.

Not really profitable but the code fits on one page.

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

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.

A simple EA based on Tipu Trend indicator and Tipu Stops indicator.

Test ChartEvent is an example demonstrating the various types of ChartEvent: keyboard keys events, mouse click & move events, custom events. The source code works both in MetaTrader 4 and MetaTrader 5.

Trailing stop allows you to automatically protect the profits with your positions. It adjusts itself according to the current market rate and the amount of pips you give it to trail behind.

123456789101112131415...29