Popular results

Advertisements
$ £ ¥
¥ £ $

Supertrend Trailing Stop MT4/MT5 Expert Advisor

Table of contents

A trailing stop is a tool that helps many Forex traders to protect their profits and limit their losses. With the Supertrend Trailing Stop MT4/MT5 EA, you can have your trades' stop-loss levels follow the famous Supertrend indicator line.


What is Supertrend Trailing Stop EA?

Supertrend Trailing Stop EA is an expert advisor for MT4 and MT5 that can manage stop-loss of your orders.

In particular, this expert advisor can use the Supertrend line for stop trailing purposes.

Supertrend is a popular indicator among traders — it is based on a mix of price averaging and ATR.

Example of Supertrend Indicator Line

Other than being a good source of entry and exit signals, Supertrend indicator is remarkable for stop-loss allocation as well.

Trailing a stop-loss to the Supertrend line can be a good strategy to let the trend's profit run.

MT4 Supertrend Trailing Stop Panel

Why use Supertrend Trailing Stop EA?

Risk management is one of the most important aspects 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 kind of 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 Supertrend Trailing Stop MetaTrader EA, the stop-loss follows the Supertrend line.

There are several advantages of using MT4/MT5 Supertrend Trailing Stop expert advisor:

  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. Limit losses.
  6. Secure profits.
  7. Avoid margin calls.
  8. Notifications when the stop-loss is updated.

Parameters

MT4 Supertrend Trailing Stop EA Input Parameters

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

  • Supertrend Indicator's File Name — the indicator name for the Supertrend line.
  • ATR Multiplier — a multiplier to use with ATR value in Supertrend.
  • ATR Period — a period for ATR indicator in Supertrend.
  • ATR Supertrend Timeframe Calculation — timeframe for ATR calculation in Supertrend.
  • Candle To Use For Supertrend Value — whether to use the most recent Supertrend value or the one from the latest completed candle.
  • Profit Points to Start Trailing — how much profit (in points) the trade must be in for trailing stop to work. Leave it at zero to ignore profit.
  • 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.
  • Show TS Price Label — if true, a price label will appear on the chart to show where the current Supertrend level is.

Download Supertrend Trailing Stop EA for MT4

You can download the expert advisor using the link below and install it in your MetaTrader 4 by following the presented instructions.

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 Supertrend 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.

Download Supertrend Trailing Stop EA for MT5

You can download the expert advisor using the link below and install it in your MetaTrader 5 platform by following the presented instructions.

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 Allow Algo 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.


MT5 Supertrend 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.
 

This trailing stop EA requires the Supertrend line indicator to work. However, it is included in the archive above, so it shouldn't be a problem.


Conclusion

One of the uses of the Supertrend indicator is to spot where the price trend may change. With this trailing stop EA, you can trail the stop-loss level based on such points. The free download also includes the open source code of the EA for you to study and improve it according to your requirements.

 

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 Supertrend Trailing Stop with other FX traders and MQL programmers on the expert advisors forums.


Changelog

1.041 — 2024-07-30 (MT5 only)

  • Fixed an issue with very long position ticket numbers in MT5.

1.04 — 2024-07-30

  • Added the MT5 version of the expert advisor.
  • Added an option to trail stop-losses only when a trade reaches some amount of profit first (ProfitPoints).
  • Added an option to select whether to use the current candle or the previous one for the trailing stop.
  • Added the trailing stop price label object to see the relevant Supertrend value without having to attach the indicator to the chart.
  • Added panel scaling on hi-DPI screens.
  • Added an input parameter to select the chart corner to place the EA's control panel.
  • Changed the EA to use the Supertrend indicator via iCustom() rather than implementing its own faulty version of Supertrend.