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

MQL5 Source Codes of Expert Advisors for MetaTrader 5 - 4

icon

Expert Advisors analyze price charts and trade automatically following underlying rules. Here you can find MQL5 source codes solving a variety of problems. You are able to select both simple Expert Advisors based on moving average crossing and complex ones involving complicated signal generation algorithms and protection against trading mistakes.

You can download and launch offered Expert Advisors in MetaTrader 5. It is recommended that you test and optimize trading robots in the Strategy Tester before using them. The library of Expert Advisors is also available directly from MetaTrader 5 platform and MetaEditor development environment.

Submit your code

Ea working well on EURUSD1 H1 with initial parameters, using a simple strategy based on Bollinger bands and RSI.

The 8 effective steps to build a robust day trading plan using Fibonacci retracement

Copy trading has become such a critical feature of forex trading. Some people see this as a potential business opportunity, while for opensource die-hards like me, we believe in giving back to the community rather than putting a price tag on everything 'nice'. So here it comes. A free opensource trade copier, which you are freely allowed to modify and distribute according to MIT license terms. It still has limited features, but the essentials like lot normalization are there. Please note that this copier only works for trading terminals installed on the same machine. Please share back any upgrades, enhancements or bug fixes to the discussion. Enjoy!

A Sample of Averaging Up/Down Martingale EA.

This is a module for MQL5 Wizard and Standard Library, which allows you to generate expert adviser based on arbitrary set of indicators and conditions.

This strategy is the well known set & forget with the ALERTING system. It is very useful on different trading scenarios. I urge you guys to always use trading tools that will make your live easier. So instead of watching the charts and the time and all day long, you can use this indicator that will watch the charts for you.

Slightly improved version of the previous one.

Trading panel that allows user to define levels of trade by simply dragging lines.

This program lists and shows information about calendar events between specified date range.

Synchronous change of a trading instrument in all charts

Trend Follower Range Breakout System with Martingale.

I want to share with you this story. When I started trading, I learnt the scalping strategy in a volatile market. I really loved scalping especially when I see the price is moving fast. However, scalping for a long period of time is exhausting to me especially in a volatile market; volatile market requires fast analysis, actions and reactions; that is why I always reach a point that I loss concentration, focus and I start making those really stupid mistakes. That is why I created this EA, that is based on the indicator Identify potential entries, that helped me to automatically identify these potential entries (based on the formation of candlesticks) instead of doing all the work myself and it will trade these potential entries for me. I know there are plenty of Metatraders who also suffer from this and that is why I would like to share this EA with you, hopefully it will be beneficial. Do not forget to send you comments as well as rate these scripts. Happy trading!

this expert opens trade in the direction of the trend when specific rate of average daily range has been passed.

this is my first try at creating an EA from ground up - update 4

Basket Closer Type EA.

This Multicurrency EA is based on Currency Strength Indicator.

It's a two (2) pairs correlation system to use 3 currencies to make 2 pairs to open hedge orders on those. The expert starts opening four orders for each couple (2 plus and 2 minus) and wait to move prices in one direction to make a grid of orders. For more information, please read the MT4 version of the expert: https://www.mql5.com/en/market/product/34112

It's a triangular arbitrage system (three pairs correlation system) to use 3 currencies to make 3 pairs to open hedge orders on those. The expert starts opening six orders for each ring (3 plus and 3 minus) and wait to move prices in one direction to make a grid of orders. For more information, please read the MT4 version of the expert: https://www.mql5.com/en/market/product/33814

You can copy the ticks and history from the MetaTrader 4 to MetaTrader 5

Margin Calculator, Point Value Calculator, Position Size Calculator, Profit Calculator and Swap Calculator.

The MelBar™ EuroSwiss 1.85x 2Y™ Expert Advisor is a specific purpose profit-scalping tool which success depends on your understanding of its underlying strategy and your ability to configure it. Backtest results using historical data from 6 February 2018 15:00 to 19 February 2020 00:00 for the EUR/CHF (M30) currency pair proves very highly profitable. Initial Deposit : US$500 Investment returns : US$1426.20 Net Profit : US$926.20 ROI : 185.24% Annualized ROI : 67.16% Investment Length : 2 years 14 days (2.04 years) Visit these websites : https://352422.e-junkie.com/product/1645482 https://www.facebook.com/TheSoftwareSuite/

NZD/USD (M30). Historical Data 18 September 2014 to 18 February 2020. Initial Deposit of US$500 acquires a Profit of US$1625.40 or Profit Return of 225% after 5½ Years. Result : Investment Gain $1,125.40 ROI 225.08% Annualized ROI 24.30% Investment Length 5.42 years MQ5 Software Program Attached. Visit these websites : https://352422.e-junkie.com/product/1645482 https://www.facebook.com/TheSoftwareSuite/

The Rapid Doji EA is a fully functional MetaTrader 5 Expert Advisor that uses pending orders (one BUY and one STOP) around each Doji candlestick on the Daily (PERIOD_D1) time frame. This is a great introduction to how to build a simple, profitable EA. You can watch, step-by-step, how this EA was built via YouTube videos. See the link in the code for details.

Welcome to the Binary Testinator. The Purpose of this EA is for testing different Indicators to optimize a trade scenario. Everyone has an opinion on what is the best trade setup, and advice is never ending! Better if you test it out...

The EA uses large volume orders to partially close other orders, with this approach, the breakeven and profit price is much closer to the current price than if you use all orders in the terminal or their full volumes.

This is a multi-currency expert adviser based on reversal strategy with martingale. Original idea is taken from ExpMartin for MT4.

Classical Sudoku puzzle right in MetaTrader chart.

Range BreakOut EA. The range is defined by the min number of bars and max width in pips. This expert advisor is designed with visual strategy builder - Mission Automate. Code is generated automatically. More info: https://www.mql5.com/en/articles/4951

Grid system with limit orders. This expert advisor is designed with visual strategy builder - Mission Automate. Code is generated automatically. More info: https://www.mql5.com/en/articles/4951

Classic strategy based on Parabolic SAR indicator. With Auto Lot options and Trailing Stop. This expert advisor is designed with visual strategy builder - Mission Automate. Code is generated automatically. More info: https://www.mql5.com/en/articles/4951

Very popular but dangerous strategy which doubles the stakes after each loosing trade. Finally, if there is enough margin it will reverse into the direction of the current price move and will eventually close in profit. This expert advisor is designed with visual strategy builder - Mission Automate. Code is generated automatically. More info: https://www.mql5.com/en/articles/4951

Classic trading strategy based on RSI levels. Buys when RSI is oversold and sells when RSI is overbought. This expert advisor is designed with visual strategy builder - Mission Automate. Code is generated automatically. More info: https://www.mql5.com/en/articles/4951

Classic and one of the most popular trading strategies based on 2 moving averages crossover. This expert advisor is designed with visual strategy builder - Mission Automate. Code is generated automatically. More info: https://www.mql5.com/en/articles/4951

Advisor for trading Gbp/Chf. Algorithm for bar opening prices. Timeframe H1.

The Expert Advisor uses four iMA (Moving Average, MA) indicators from two timeframes. Two indicators with averaging periods 1 and 8 are created on the H1 timeframe and two indicators with averaging periods 1 and 8 are also created on the H4 timeframe.

Advisor scalper. Trading algorithm: Candle[0]> Candle[1] * 2. Taimeframe - 4H && Day.

A trading system based on custom indicator VHF.

Expert Advisor Exp_SpearmanRankCorrelation_Histogram with the added option of trading within the weekly range only, the borders of which are specified in the EA's input settings

A trading system with a very simple neural network unit. It uses an iMA (Moving Average, MA) on H1, H4, and D1.

Searching for a daily range. We use OBJ_HLINE, OBJ_VLINE.

1234567891011...36