OPEN-SOURCE SCRIPT
已更新 % / ATR Buy, Target, Stop + Overlay & P/L

% / ATR Buy, Target, Stop + Overlay & P/L
This tool combines volatility‑based and fixed‑percentage trade planning into a single, on‑chart overlay—with built‑in profit‑and‑loss estimates. Toggle between ATR or percentage modes, plot your Buy, Target and Stop levels, and see the dollar gain or loss for a specified position size—all in one interactive table and chart display.
NOTE: To activate plotted lines, price labels, P/L rows and table values, enter a Buy Price greater than zero.
What It Does
Mode Toggle: Choose between “ATR” (volatility‑based) or “%” (fixed‑percentage) calculations.
Buy Price Input: Manually enter your entry price.
ATR Mode:
Target = Buy + (ATR × Target Multiplier)
Stop = Buy − (ATR × Stop Multiplier)
Percentage Mode:
Target = Buy × (1 + Target % / 100)
Stop = Buy × (1 – Stop % / 100)
P/L Estimates: Specify a dollar amount to “invest” at your Buy price, and the script calculates:
Gain ($): Profit if Target is hit
Loss ($): Cost if Stop is hit
Visual Overlay: Draws horizontal lines for Buy, Target and Stop, with optional price labels on the chart scale.
Interactive Table: Displays Buy, Target, Stop, ATR/timeframe info (in ATR mode), percentages (in % mode), and P/L rows.
Customization Options
Line Settings:
Choose color, style (solid/dashed/dotted), and width for Buy, Target, Stop lines.
Extend lines rightward only or in both directions.
Table Settings:
Position the table (top/bottom × left/right).
Toggle individual rows: Buy Price; Target (multiplier or %); Stop (multiplier or %); Target ATR %; Stop ATR %; ATR Time Frame; ATR Value; Gain ($); Loss ($).
Customize text colors for each row and background transparency.
General Inputs:
ATR length and optional ATR timeframe override (e.g. use daily ATR on an intraday chart).
Target/Stop multipliers or percentages.
Dollar Amount for P/L calculations.
How to Use It for Trading
Plan Your Entry: Enter your intended Buy Price and position size (dollar amount).
Select Mode: Toggle between ATR or % mode depending on whether you prefer volatility‑based or fixed offsets.
Assess R:R and P/L: Instantly see your Target, Stop levels, and potential profit or loss in dollars.
Visual Reference: Lines and price labels update in real time as you tweak inputs—ideal for live trading, backtesting or trade journaling.
Ideal For
Traders who want both volatility‑based and percentage‑based exit options in one tool
Those who need on‑chart P/L estimates based on position size
Swing and intraday traders focused on objective, rule‑based trade management
Anyone who uses ATR for adaptive stops/targets or fixed percentages for simpler exits
This tool combines volatility‑based and fixed‑percentage trade planning into a single, on‑chart overlay—with built‑in profit‑and‑loss estimates. Toggle between ATR or percentage modes, plot your Buy, Target and Stop levels, and see the dollar gain or loss for a specified position size—all in one interactive table and chart display.
NOTE: To activate plotted lines, price labels, P/L rows and table values, enter a Buy Price greater than zero.
What It Does
Mode Toggle: Choose between “ATR” (volatility‑based) or “%” (fixed‑percentage) calculations.
Buy Price Input: Manually enter your entry price.
ATR Mode:
Target = Buy + (ATR × Target Multiplier)
Stop = Buy − (ATR × Stop Multiplier)
Percentage Mode:
Target = Buy × (1 + Target % / 100)
Stop = Buy × (1 – Stop % / 100)
P/L Estimates: Specify a dollar amount to “invest” at your Buy price, and the script calculates:
Gain ($): Profit if Target is hit
Loss ($): Cost if Stop is hit
Visual Overlay: Draws horizontal lines for Buy, Target and Stop, with optional price labels on the chart scale.
Interactive Table: Displays Buy, Target, Stop, ATR/timeframe info (in ATR mode), percentages (in % mode), and P/L rows.
Customization Options
Line Settings:
Choose color, style (solid/dashed/dotted), and width for Buy, Target, Stop lines.
Extend lines rightward only or in both directions.
Table Settings:
Position the table (top/bottom × left/right).
Toggle individual rows: Buy Price; Target (multiplier or %); Stop (multiplier or %); Target ATR %; Stop ATR %; ATR Time Frame; ATR Value; Gain ($); Loss ($).
Customize text colors for each row and background transparency.
General Inputs:
ATR length and optional ATR timeframe override (e.g. use daily ATR on an intraday chart).
Target/Stop multipliers or percentages.
Dollar Amount for P/L calculations.
How to Use It for Trading
Plan Your Entry: Enter your intended Buy Price and position size (dollar amount).
Select Mode: Toggle between ATR or % mode depending on whether you prefer volatility‑based or fixed offsets.
Assess R:R and P/L: Instantly see your Target, Stop levels, and potential profit or loss in dollars.
Visual Reference: Lines and price labels update in real time as you tweak inputs—ideal for live trading, backtesting or trade journaling.
Ideal For
Traders who want both volatility‑based and percentage‑based exit options in one tool
Those who need on‑chart P/L estimates based on position size
Swing and intraday traders focused on objective, rule‑based trade management
Anyone who uses ATR for adaptive stops/targets or fixed percentages for simpler exits
發行說明
Version Updates:Added ATR Smoothing Options ("RMA", "SMA", "EMA", "WMA")
Removed random line settings from the "Styles" tab.
發行說明
Cleaned up settings screen開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。