TradeAutomation

ATR Trailing Stop v5

One of my favorite stops is the ATR Trailing Stop-loss. With the implementation of PineScript v5, a code update was needed in order to use this stop/exit-strategy with newer strategy scripts. A timeframe selector that was not featured on earlier versions is also included. This new version can be plugged into PineScript v5 strategies, and also has a simpler/cleaner code that makes the code logic easier to follow than prior versions.

For those that are unfamiliar with the ATR Trailing Stop exit strategy; it is a trailing stop that takes into account the volatility of the underlying asset by trailing the price series using a multiple of the Average True Range (ATR). In practice I’ve found that this exit can be more effective than traditional trailing stops, depending on the volatility of the asset you are trading. More detailed information can be found at www.stockopedia.com/...ailing-stops-462698/

How do I use it? Add it to your chart as an indicator to visualize where the ATR stop would be with your settings. Or, copy and add it to your v5 strategy with the addition of a ta.crossunder(close, ATRTrailingStop) or ta.crossover(close, ATRTrailingStop) function. Special thanks and credit to HPotter who coded an earlier version of this in pine!

Want to build custom alerts and custom strategies? Interested in automated trading?

Hire me to code or automate your trading strategy, or schedule a free consultation at:
www.TradeAutomation.net
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?