SAR Trading System - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 Resources



The SAR trading system illustrates the operation of Stop and Reversal (SAR) developed by Welles Wilder. The Expert Advisor checks whether there is an open position and starts moving the stop loss with parabolic acceleration, which is determined by the parameters of the parabolic system.
Each time a new bar is opened, the EA moves the stop loss by the value determined by the parabola. Due to the acceleration factor, the amount of stop moves steadily increases. As a result, the stop loss moves significantly faster. The SAR system is described in more detail below.
Although Wilder envisioned SAR to reverse positions when the parabola hits the current price, the proposed system uses SAR as an effective trailing stop.
The option to open random buy or sell positions is provided to illustrate the operation of the stop-loss tracking system in the EA. The EA will open random positions only if the "Random Trade Toggle" switch is set to "True". If the switch is set to "False", the EA will not open a position on its own.
However, the parabolic system is still active. That is, the EA can track positions opened manually or by other experts.
The EA also has the feature to delay the opening of new positions for a certain period of time. The delay time is set by the timer.


The following are the EA's external parameters and brief comments:

Each time a new bar is opened, the system must calculate a new stop loss value. For long positions, the new value is calculated as follows:
SAR(n+1) = SAR(n) +AF x [EP - SAR(n)].
Therefore, for short positions, the new stop loss value is calculated as follows:
SAR(n+1) = SAR(n) - AF x [SAR(n) - EP],
Attachment download
📎 sartrailingsystem.mq5 (8.82 KB)
Source: MQL5 #16087
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •