OPEN-SOURCE SCRIPT
Daily ATR Projection [EDGE]

Daily ATR Projection [EDGE].
Projects the previous daily close plus and minus 0.5 and 1.0 ATR(D) as five horizontal levels on the current chart, and shows the same levels together with a live ATR% amplitude reading in a compact dashboard. Built for intraday traders who want a fixed, non-repainting map of how much room the day still has before the session has statistically exhausted its average range.
How it works:
The indicator requests the previous completed daily bar via request.security(sym, "D", [close[1], atr_expr[1]], lookahead = barmerge.lookahead_on). The two values it pulls — previous daily close and previous daily ATR — are always finalised bar data, so the projection never repaints during the intraday session. From those two numbers it computes four projected levels: previous close plus and minus 0.5 x ATR(D) and plus and minus 1.0 x ATR(D). The fifth line is the previous daily close itself.
On every last bar the five levels are (re)anchored using xloc.bar_time so they extend the requested number of bars to the right of the current bar, without being clipped by empty space in the chart layout. When the smoothing method is changed the ATR expression is recomputed inside a single helper so RMA, SMA, EMA and WMA all share the same request.security call.
What it calculates:
- Prev Close — previous daily close, drawn as the middle reference line.
- +100% — previous close + 1.0 x ATR(D), the upper edge of the expected daily range.
- +50% — previous close + 0.5 x ATR(D), the mid upside marker.
- -50% — previous close - 0.5 x ATR(D), the mid downside marker.
- -100% — previous close - 1.0 x ATR(D), the lower edge of the expected daily range.
- 1 ATR, % — the previous daily ATR expressed as a percentage of the previous daily close, i.e. today's average expected amplitude.
- Distance-to-price row — signed distance from each of the four ATR levels to the current close, so the trader can see how much of the daily potential is still available in each direction.
Key features:
- Non-repainting daily ATR — data is pulled from the previous completed D1 bar; intraday bars never see values that have not been finalised.
- Adjustable smoothing — RMA (Wilder), SMA, EMA or WMA on the daily True Range.
- ATR multiplier — 1.0 keeps the classic envelope, 0.5-2.0 for tighter or wider projections.
- Right-extension control — line reach is configured in bars of the current timeframe, so the levels stay visible on any chart scale.
- Toggle for the middle line — turn off the previous daily close if a separate PDC indicator is already loaded.
- Compact dashboard with six anchor positions (top / bottom / middle, left / centre / right) and four text sizes.
- Two-row value grid — absolute level values on one row, signed distance to current close on the row below.
- Live 1 x ATR(D) amplitude reading with an inline tooltip mapping the reading to volatility regimes (low / normal / elevated / extreme).
- Meaning-encoded colour scale — deep green and deep red for the outer plus / minus 100% boundaries, softer green and red for plus / minus 50%, neutral grey for the previous close. Every colour is exposed as input.color and can be overridden.
- All input labels, tooltips and dashboard captions in English.
Who it's for:
Intraday and short-horizon swing traders who plan entries against the previous daily close and want a fixed, statistically grounded map of the day's realistic upside and downside potential. Useful for session-based playbooks (open, mid-day, close), for measuring how much of the average day has already been printed before committing to a continuation trade, and as a discipline overlay for fade traders who prefer to avoid taking reversal setups after price has already consumed the full daily amplitude.
Projects the previous daily close plus and minus 0.5 and 1.0 ATR(D) as five horizontal levels on the current chart, and shows the same levels together with a live ATR% amplitude reading in a compact dashboard. Built for intraday traders who want a fixed, non-repainting map of how much room the day still has before the session has statistically exhausted its average range.
How it works:
The indicator requests the previous completed daily bar via request.security(sym, "D", [close[1], atr_expr[1]], lookahead = barmerge.lookahead_on). The two values it pulls — previous daily close and previous daily ATR — are always finalised bar data, so the projection never repaints during the intraday session. From those two numbers it computes four projected levels: previous close plus and minus 0.5 x ATR(D) and plus and minus 1.0 x ATR(D). The fifth line is the previous daily close itself.
On every last bar the five levels are (re)anchored using xloc.bar_time so they extend the requested number of bars to the right of the current bar, without being clipped by empty space in the chart layout. When the smoothing method is changed the ATR expression is recomputed inside a single helper so RMA, SMA, EMA and WMA all share the same request.security call.
What it calculates:
- Prev Close — previous daily close, drawn as the middle reference line.
- +100% — previous close + 1.0 x ATR(D), the upper edge of the expected daily range.
- +50% — previous close + 0.5 x ATR(D), the mid upside marker.
- -50% — previous close - 0.5 x ATR(D), the mid downside marker.
- -100% — previous close - 1.0 x ATR(D), the lower edge of the expected daily range.
- 1 ATR, % — the previous daily ATR expressed as a percentage of the previous daily close, i.e. today's average expected amplitude.
- Distance-to-price row — signed distance from each of the four ATR levels to the current close, so the trader can see how much of the daily potential is still available in each direction.
Key features:
- Non-repainting daily ATR — data is pulled from the previous completed D1 bar; intraday bars never see values that have not been finalised.
- Adjustable smoothing — RMA (Wilder), SMA, EMA or WMA on the daily True Range.
- ATR multiplier — 1.0 keeps the classic envelope, 0.5-2.0 for tighter or wider projections.
- Right-extension control — line reach is configured in bars of the current timeframe, so the levels stay visible on any chart scale.
- Toggle for the middle line — turn off the previous daily close if a separate PDC indicator is already loaded.
- Compact dashboard with six anchor positions (top / bottom / middle, left / centre / right) and four text sizes.
- Two-row value grid — absolute level values on one row, signed distance to current close on the row below.
- Live 1 x ATR(D) amplitude reading with an inline tooltip mapping the reading to volatility regimes (low / normal / elevated / extreme).
- Meaning-encoded colour scale — deep green and deep red for the outer plus / minus 100% boundaries, softer green and red for plus / minus 50%, neutral grey for the previous close. Every colour is exposed as input.color and can be overridden.
- All input labels, tooltips and dashboard captions in English.
Who it's for:
Intraday and short-horizon swing traders who plan entries against the previous daily close and want a fixed, statistically grounded map of the day's realistic upside and downside potential. Useful for session-based playbooks (open, mid-day, close), for measuring how much of the average day has already been printed before committing to a continuation trade, and as a discipline overlay for fade traders who prefer to avoid taking reversal setups after price has already consumed the full daily amplitude.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.