Advertisements
$ £ ¥
¥ £ $

ATR Trailing Stop MT4/MT5 Expert Advisor

A trailing stop is a risk management method that is very popular among Forex traders. With the ATR Trailing Stop MetaTrader EA, you can make your orders' stop-loss levels use an ATR-based distance from the current price.


What is ATR Trailing Stop MT4/MT5 EA?

ATR Trailing Stop MT4/MT5 EA is an expert advisor that can manage your stop-loss orders.

In particular, this expert advisor can use average true range (ATR) values to set the stop-loss for your orders.

Average true range is a popular indicator among all financial traders. It can be used to measure volatility of the price movements.

This makes the ATR indicator good not only for risk-based position sizing but also for using as a stop-loss distance.

Trailing your stop-loss with the ATR value can be a good idea in several situations.

ATR Trailing Stop MT4 Expert Advisor - Stop-Loss Distance Equals the ATR Value


Why Use ATR Trailing Stop MT4/MT5 EA?

Risk management is one of the most important aspect in trading. Having a stop-loss will protect you from margin calls and big losses.

In many cases, it is useful to have a trailing stop, which is a "moving stop". A trailing stop is a stop-loss where the value is updated when the price moves in the favor of the trade.

There are many types of trailing stop — it can be a fixed step change or it can follow some indicator.

In the case of ATR Trailing Stop expert advisor for MetaTrader, the stop-loss distance follows the volatility-derived ATR values.

There are several reasons for using ATR Trailing Stop EA in your MT4 or MT5 platform:

  1. Filtering options to select which trades are managed.
  2. A stop-loss is set automatically if there is none.
  3. The stop-loss follows the price when moving in the favor of the trade.
  4. It doesn't require human interaction.
  5. Track one or multiple symbols.
  6. Limit losses.
  7. Secure profits.
  8. Avoid margin calls.
  9. Notifications when the stop-loss is updated.

Parameters

MT4 ATR Trailing Stop EA Input Parameters

This expert advisor supports the following input parameters to be configured by the trader:

  • ATR Period — a period for ATR indicator value calculation.
  • Shift In The ATR Value — better leave it at '1'.
  • ATR Multiplier — a multiplier to use with the ATR value when calculating stop-loss distance.
  • Apply To Current Symbol Only — if true, TS will apply only to the current chart's symbol; otherwise, will trail orders on all symbols.
  • Apply To — select which types of orders to apply a trailing stop to.
  • Filter By Magic Number — true or false depending on whether you want to modify only the orders with a specific magic number.
  • Magic Number — specify the magic number in case the above is true.
  • Filter By Comment — true or false depending on whether you want to modify only the orders with a specific comment.
  • Comment — specify the comment if the above is true.
  • Enable Trailing Stop — if true, the EA is active and is trailing stop-losses.
  • Enable Notifications feature — if true, the EA will send notifications upon triggering.
  • Send Alert Notification — if true, the EA will issue native on-screen alerts.
  • Send Notification to Mobile — if true, the EA will send push-notifications to your mobile device.
  • Send Notification via Email — if true, the EA will send emails when it updates a stop-loss.
  • Show Graphical Panel — if true, a graphical panel will appear on the chart to control the expert advisor.

If you set Apply To Current Symbol Only to false, the EA will calculate ATR for the order's symbol, regardless of the symbol it is attached to. However, the timeframe for ATR calculation will be taken from the chart the expert advisor is attached to.


Downloads

You can download the expert advisor using the links below depending one platform you are using. You can then install it by following the presented instructions.

➥ Download MQLTA MT4 ATR Trailing Stop

➥ Download MQLTA MT5 ATR Trailing Stop

The installation is very easy to perform; the same is the use. Once you run the expert advisor, you can set all the necessary input parameters.

Make sure you enable Live Trading in the Common tab when attaching the EA and also in the platform's menu Tools→Options→Expert Advisors. Otherwise, it won't be able to modify orders.

How to Enable Live Trading for Expert Advisors in MT4?


MT4 ATR Trailing Stop EA Installation

To install the EA in MT4, please follow the instructions below:

  1. Download the expert advisor archive file.
  2. Open the MetaTrader 4 data folder (via File→Open Data Folder).
  3. Open the MQL4 Folder.
  4. Copy all the folders from the archive directly to the MQL4 folder.
  5. Restart MetaTrader 4 or refresh the expert advisors list by right-clicking the Navigator subwindow of the platform and choosing Refresh.

Or you can read a more detailed instruction on how to perform the installation.

MT5 ATR Trailing Stop EA Installation

To install the EA in MT5, please follow the instructions below:

  1. Download the expert advisor archive file.
  2. Open the MetaTrader 5 data folder (via File→Open Data Folder).
  3. Open the MQL5 Folder.
  4. Copy all the folders from the archive directly to the MQL5 folder.
  5. Restart MetaTrader 5 or refresh the expert advisors list by right-clicking the Navigator subwindow of the platform and choosing Refresh.

Or you can read a more detailed instruction on how to perform the installation.

 

You can open a trading account with any of the MT4 Forex brokers to freely use the presented here expert advisor for MetaTrader 4. If you want to use an MT5 version of the expert advisor presented here, you would need to open an account with a broker that offers MetaTrader 5.

Discussion

Do you have any suggestions or questions regarding this expert advisor? You can always discuss ATR Trailing Stop with other FX traders and MQL programmers on the expert advisors forums.


Changelog

1.07 — 2023-05-25

  • Fixed various bugs that could inhibit normal operation of the EA.

1.06 — 2023-05-08

  • Added an MT5 version of the expert advisor.
  • Added panel scaling on hi-DPI screens.
  • Fixed stop-loss calculation on other symbols.
  • Fixed the calculation process to take into account the symbol's tick size (useful for CFDs).