OPEN-SOURCE SCRIPT
Trailing Stop + Profit Target

Trailing Stop + Exit Confirmation is a manual-entry tool designed to help traders visually manage trades with dynamic trailing stops and profit targets, based on ATR projections with a toggle button to reset calculations in real-time. Contains a “Short” toggle to work for short positions as well, which automatically inverses the PT and SL lines when toggled on.
Primary Calculations: Utilizes a manually adjustable entry price (default: $5 — ideal for options traders) that (when adjusted and recalculated) populates the chart with an adaptive ATR-based trailing stop line, dynamic profit target line, and optional 21-day EMA for directional context.
Below the Entry Price is a fully functional, manual reset toggle to reset all parameters mid-session to assess risk-reward based on entry price, risk tolerance, etc. followed by the “Short” toggle.
Primary Directions/Functions:
Enter your trade price in the “Manual Entry Price” field.
The script will begin plotting a dynamic trailing stop and profit target based on current market conditions.
Use the reset toggle to clear all calculations and start a new position at any time.
Customizable Settings:
ATR Length and Multiplier
Risk/Reward Profit Target Multiplier
Toggle to show/hide trailing stop, target, and EMA lines
Options Trading Use Case:
This tool is especially useful for options traders looking to manage premium-based entries (e.g., $5.00) on intraday or swing trades. The dynamic stop and target lines provide clear visual cues for scaling out or exiting based on price action, while allowing for tighter or looser risk depending on volatility (ATR).
This tool does not auto-detect entries or backtest positions. It is intended to complement your entry signals, not generate them. I've written an Options Momentum Signal indicator you can find right here
which functions well in tandem with this tool.
Made for traders who execute trades manually and want typical preset guidelines for profit and stop loss signals but lets you recalculate them by simply clicking a button, especially if any major news or downturn causes a big change in market conditions so you can make adjustments in real time.
Primary Calculations: Utilizes a manually adjustable entry price (default: $5 — ideal for options traders) that (when adjusted and recalculated) populates the chart with an adaptive ATR-based trailing stop line, dynamic profit target line, and optional 21-day EMA for directional context.
Below the Entry Price is a fully functional, manual reset toggle to reset all parameters mid-session to assess risk-reward based on entry price, risk tolerance, etc. followed by the “Short” toggle.
Primary Directions/Functions:
Enter your trade price in the “Manual Entry Price” field.
The script will begin plotting a dynamic trailing stop and profit target based on current market conditions.
Use the reset toggle to clear all calculations and start a new position at any time.
Customizable Settings:
ATR Length and Multiplier
Risk/Reward Profit Target Multiplier
Toggle to show/hide trailing stop, target, and EMA lines
Options Trading Use Case:
This tool is especially useful for options traders looking to manage premium-based entries (e.g., $5.00) on intraday or swing trades. The dynamic stop and target lines provide clear visual cues for scaling out or exiting based on price action, while allowing for tighter or looser risk depending on volatility (ATR).
This tool does not auto-detect entries or backtest positions. It is intended to complement your entry signals, not generate them. I've written an Options Momentum Signal indicator you can find right here

Made for traders who execute trades manually and want typical preset guidelines for profit and stop loss signals but lets you recalculate them by simply clicking a button, especially if any major news or downturn causes a big change in market conditions so you can make adjustments in real time.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.