OPEN-SOURCE SCRIPT
Actualizado

% / ATR Buy, Target, Stop + Overlay & P/L

508
% / 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
Notas de prensa
Version Updates:

Added ATR Smoothing Options ("RMA", "SMA", "EMA", "WMA")

Removed random line settings from the "Styles" tab.
Notas de prensa
Cleaned up settings screen
Notas de prensa
Version changes:

  • Added dollar amount display to table.
  • Added shares at cost calculation to table.
  • Set default line behavior to extend both directions.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.