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

MQL5 Source Codes of Expert Advisors for MetaTrader 5 - 3

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

Automatically export csv file

One code that works for both Mt4 and Mt5 combined. Salient features of the code: -Filter News by High, Low or Medium Volatility -Filter By currencies -Filter by News Keyword -Auto GMT offset check -Dashboard to show upcoming News (Can be enabled or disabled) -Lines on chart for all Upcoming events -Code can be easily modified to place trade at certain time before or after an event or to just stop trading during events.

This EA started off as a job to trail equity. I then added the function of managing individual trades. Thereafter I added the facility of manually putting the price of when it can send a grid of pending order's. This EA does not have condition set in it to open trades. You have to determine that if market moves to an area you believe you would open a grid of orders if you were by your computer watching the market. No what this EA helps is you wake up in the morning you see the area you a grid to open. PUT THE PRICE FOR THE EA TO OPEN A GRID OF PENDING ORDERS. If the market reaches the area price you have set. The EA will send the grid and will manage those trades putting Stop Loss (if you set it) trailing(if you set it). Today 13 Sep 2022 the EA generates has NO ERROR when compiled

Source code of simple order panel

Modify to allow direct specification of the starting point of the Parabolic SAR.

Two pending orders at the beginning of the day

The Expert Advisor is a joke: the position is opened randomly. Now there is a Stop Loss, Take Profit and much more

Expert is a joke! The position is opened at random!

A simple trading system using the custom indicator "WPR Custom Cloud"

Simple EA on 'iVIDyA' indicator

Trading strategy for the custom indicator 'OsMA Four Colors Arrow EA'

Martingale based on custom indicator 'VIDYA N Bars Borders'

Finalization of previous version. Now, when opening a 'SELL' position, we immediately close all 'BUY' positions and vice versa: when opening a 'BUY' position, we immediately close all 'SELL' positions

Trading strategy based on the iAMA (Adaptive Moving Average, AMA) and iRSI (Relative Strength Index, RSI) indicator. Doubling the position at a loss (not Martingale!)

Just a very simple expert that execute orders from a text file.

Strategy based on custom indicator 'RSI Dual Cloud'. Four types of signals

Shows your position size through a comment from any symbol chart based on a risk percent on daily ATR, you can use either balance or equity.

Development of the first version. Added parameters 'Maximum number of positions' and 'Minimum step of positions'

Strategy based on the 'DeMarker' indicator, working with pending orders

Version 2: extended functionality (added a few extra options)

Assistant - works on the current symbol, has the 'Trailing activate if profit is >=' parameter in the trailing parameters. Sets the initial Stop Loss and Take Profit. Closes all positions when target profit is reached

Assistant - works on the current symbol, has the 'Trailing activate if profit is >=' parameter in the trailing parameters

Советник-утилита. Показывает суммарную прибыль за несколько периодов (сумму и в %), количество сделок за несколько периодов. Расчёт по заданному символу и magic number

Martingale strategy based on custom indicator 'MACD Four Colors 2'

Trading strategy based on the custom indicator 'MA on Momentum'

Detecting the start of a new bar or candle, in the OnTick() event handler of an expert advisor.

One of the strategies for the 'DeMarker' indicator is a permanent set of positions

The EA works on the signals of the custom indicator 'PriceChannel_Signal_v2' ( https://www.mql5.com/en/forum/173249/page132#comment_15924070 )

Trading strategy for the custom indicator 'CHO Smoothed EA'

Very simplified code: intersection of two custom indicators 'MA Other TimeFrame Correct'. There is no Stop Loss, Take Profit or Trailing.

Strategy based on the signals of the custom indicator 'RSI_MAonRSI_Dual'

Strategy based on the custom indicator 'RSI_MAonRSI_Filling'. The minimum step is set between positions

Reverse candle patterns

Around the moving average index to set grid.

Proportional grid distance, open long and short orders at the same time, skip two grids to take profit; When the equity recaches the take profit of setting, close all positions and restart.

Single Currency or Manual orders Closing or deleting sections are very easy to understand but if you have a question you leave it at comment section. The code check for Comment to detect the Orders to close or delete for multi currencies EA in case the input EAComment is empty It will close according to type of close. It supports prefix or suffix of EA Comment. Many options can be added if you are interested on developping it more you can leave your suggestion on comment section.

Set Trailing Stop only when profit

This EA help you to auto set the TP, SL & TRAILING by default, easy to close all orders with button "Close All" *Update April 2022. Channge ushor to ulong to support giant spread like Boom/Crash Synthetic Symbols

Open Pending order After Position Get StopLoss

This code use close all profit at end of week for currency pair

12345678910...36