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
סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יכולים להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אך שימוש חוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.

כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.

רוצה להשתמש בסקריפ זה בגרף?