Simple Moving Average - ATR Trailing StopThe old adage goes "Cut losers fast and let the winners run"
With this in mind, this will plot a dynamic trailing stop by subtracting any multiplier of the Average True Range (ATR) from the SMA of your choice.
Trailingstoploss
ATR + Trailing StopsSimple visualisation of Average True Range in Pinescript V4.
The script has two modes: Running and Trailing.
In Running mode, it continuously displays the ATR above and below the price. Specifically, it displays the High and Low price plus and minus the ATR times a user-supplied multiplier. This can be helpful for visualising volatility.
In Trailing mode, it displays the same ATR line, except the line trails until price crosses it. When price crosses it, it flips from long to short or vice-versa.
You could use trailing ATR as a stop loss. Adjust the multiplier and lookback period for your asset and preference.
ATR ChannelsATR Channels help you to identify where to place your stop-loss or trailing stop-loss based on price volatility, according to the Average True Range (ATR).
Adaptive Autonomous Recursive Trailing StopIntroduction
Trailing stop are important indicators in technical analysis, today i propose a new trailing stop A2RTS based on my last published indicator A2RMA (1), this last indicator directly used an error measurement thus providing a way to create enveloppes, which provide a direct way to create trailing stops based on highest/lowest rules.
The Indicator
If you need a more detailed explanation of this indicator i encourage you to check the A2RMA indicator post i made, parameters does not differ from the supertrend, thus having a length parameter and a factor parameter who is here described as gamma , gamma control how far away are the bands from each others thus spotting longer terms trends when gamma is higher.
On BTCUSD
Something worth mentioning is that the indicator sometimes behave like my MTA trailing stop indicator (2) who is closer to the price when a trend persist thus providing early exit points, however A2RTS behave a bit better.
Price can sometimes break the trailing stop, this can be interpreted as a support/resistance or just as an exit point, the support resistance methodology on trailing stop is not the most recommended.
Sometimes it is recommended to have an higher length rather than an high gamma like in this case for INTEL CORP, below gamma = 3 and length = 20
The microprocessor market like to use higher length's instead of higher gamma's , A2RMA is a non-linear filter, this would explain such behaviour.
Conclusion
Trailing stops might not suffer as much from whipsaw trades than MA crossovers but they still remain inefficient when market is not trending, results of the proposed indicator on major forex pairs are more than disappointing, but i hope this will serve as basis for other trailing stops that might act a little bit better. I conclude this post by thanking everyone who support my work and i encourage you to modify this indicator and share it with the community.
Thanks for reading !
Cited Articles
Supertrend collectorHello traders
This is an example of how you can add multiple indicators into a unique one
In this instance, I added two supertrend multitimeframes and draw them on a different timeframe chart
Enjoy
David
Modified Gann HiLo ActivatorIntroduction
The gann hilo activator is a trend indicator developed by Robert Krausz published into W. D. Gann Treasure Discovered: Simple Trading Plans for Stocks & Commodities . This indicator crate a trailing stop aiming to show the direction of the trend.
This indicator is fairly easy to compute and dont require lot of skills to understand. First we calculate the simple moving average of both price high and price low, when the close price is higher than the moving average of the price high the indicator return the moving average of the price low, else the indicator return the moving average of the price high if the close price is lower than the moving average of the price low.
My indicator add a different calculation method in order to avoid whipsaw trades as well as adding significance to the moving average length. A Median method has been added to provide more robustness.
The Indicator
The indicator is a simple trailing stop aiming to show the direction of the trend. The indicator use a different source instead of the price high/low for its calculation. The first method is the "SMA" method which like the classic hilo indicator use a simple moving average for the calculation of the indicator.
Sma Method with length = 25
The "Median" use a moving median instead of a simple moving average, this provide more robustness.
Median Method with length = 25
The shape is less curved and the indicator can sometimes avoid whipsaw with high's length periods.
Mult Parameter
The mult parameter is a parameter set to be lower or equal to 1 and greater or equal to 0. High values allow the indicator to be far from the price thus avoiding whipsaw trades, lower ones lower the distance from the price. A mult parameter of 0.1 approximate the original hilo indicator.
In blue the indicator with mult = 0.1 and in radical red the original hilo activator.
Conclusion
The modifications allow more control over the indicator as well as adding more robustness while the original one is destined to fail when market price is more complex.
Thanks for reading :)
For any questions/suggestions feel free to pm me
Parabolic SARThis is a redesign of the built-in Parabolic SAR indicator. I added a proper input system, an option to highlight initial points for both lines and an option to choose points width. So, customize it as you want.
Parabolic SAR was originally developed by J. Welles Wilder and described in his book "New Concepts in Technical Trading Systems" (1978). It is a trend-following indicator that can be used as a trailing stop loss.
To know which settings for PSAR are the most profitable on your instrument and timeframe you can use this tool
Profitable Parabolic SAR
MTA-Traling StopIntroduction
Based on my previous indicator , this indicator plot a trailing stop using classic conditions.
Using The Indicator
Like any trailing stop when price is higher than the trailing stop this imply a buy signals, when price is lower than the trailing stop this imply a sell signal. It is possible to use decimals instead of integers for length as shown here :
length = 14.7
The indicator tend to react faster to price movements when a trend has been really long, this methodology is similar to the one used by the parabolic sar.
Downsides
Lack of robustness with the length parameter, the behaviour of the trailing stop can be hard to predict. There is a real need for control.
Conclusion
The indicator can be adaptive, even if it already is in a certain way, by changing the alpha variable at the start considering that 0 < alpha < 1. Its not recommended to use it right now except for testing/coding purpose.
It is clear that i'm not enthusiast when it come to this script, there is a real lack of accuracy, i still hope it can be of use.
Chandelier ExitThis is a redesign of the Chandelier Exit indicator. It removes stupid transitions between Chandelier Exit' states and highlights initial points for both lines.
This indicator was originally developed by Charles Le Beau and popularized by Dr. Alexander Elder in his book "Come Into My Trading Room: A Complete Guide to Trading" (2002).
In short, this is a trailing stop-loss based on the Average True Range (ATR).
SuperTrendThis is a redesign of the SuperTrend indicator. It removes stupid transitions between SuperTrend states and highlights initial points for both lines.
SuperTrend is a moving stop and reversal line based on the volatility (ATR).
Trailing Stop Loss MTFMultiple Time Frame Version of Trailing Stop Loss Indicator
TRAILING STOP LOSS INDICATOR is a helpful tool for traders to help one of the greatest problems that they face: where to sell?
by using trailing stop loss you can easily decide and see possible downward movements and understand if you are in a safe zone.
Using Trailing Stop Loss is just simple:
Go short/ Sell when price crosses down the indicator,
Stay on long position if prices are above the indicator.
The indicator is calculated from previous Lows and doesn't the value won't change until prices makes higher lows.
TURKISH EXPLANATION:
İz Süren Stop Loss İndikatörü
Adım 1- bu günün düşük fiyatından geriye doğru, daha düşük fiyatlı bir günle karşılaşıncaya kadar yatay bir çizgi çizin
bu sizin birinci countback’ iniz olacak.
Adım 2- bu yeni düşük günün düşük fiyatından geriye doğru tekrar bir başka düşük güne gelene kadar yatay bir çizgi
çekin. Bu sizin ikinci countback’ iniz olacak.
Adım 3- bu ikinci düşük günün düşüğünden ileri bu günkü tarihe kadar yatay bir çizgi çekin bu sizin talimat
verdiğinizde stop-loss noktanız oluyor.
Kural 1- asla aşağıya doğru stop koymayın. Eğer yeni stop-loss noktanız öncekinden daha düşükse onu atıyorsunuz.
Bu kural asla bozulmamalı.
Kural 2- countback çizginiz üzerindeki aynı düşük fiyata denk gelen günleri yok sayın. İkinci contback çizginizi çekmek
için ilkinden daha düşük bir nokta bulmalısınız. Eğer aynı düşük fiyata sahip bir çubuğa denk gelirseniz daha düşüğünü
buluncaya kadar devam edin. Gerçekten hepsi bu kadar. Bu kuralları uygulayarak stop-loss noktamızı her yeni günün
datası eklendikçe uzatabiliriz.
drive.google.com