ZenAndTheArtOfTrading

Trailing Stop Alerts

This script is designed as an ATR-based trailing stop tool to assist in managing open positions.

Once you're involved in a profitable trade, if you add this script to your chart you'll be prompted to select a bar to begin trailing from.

You can then adjust the candle lookback distance for swing high/lows (7 by default), the ATR multiplier (1.0 by default), and the direction to trail (Long/Short).

You can also adjust the ATR period in the settings menu if you want to (14 period by default).

Once the script is added to your chart, it will begin drawing your trailing stop and you can then set up alerts.

Alert Options:
Any alert() function call: Will trigger an alert for both conditions (trailing stop updated, trailing stop hit)
Alert Conditions: Trailing Stop Update will trigger whenever the stop is updated, Trailing Stop Hit will trigger whenever the stop is hit.

Note: the alerts will only fire once per bar close and the trailing stop will not update on realtime bars.

My Resources Hub: theartoftrading.com
FREE YouTube Lessons: rebrand.ly/zyt
FREE Pine Script Basics Course: rebrand.ly/zpsbc
Pine Script MASTERY Course: rebrand.ly/zpsmc
My Indicators & Strategies: rebrand.ly/zmisc
Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Отказ от ответственности

Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.

Хотите использовать этот скрипт на графике?