Indicator · Pine Script v6 · Own pane

Webby's ATR Off 52-Week High

by peterdmv

This indicator measures how far the current low sits below the highest high of the last 252 bars, expressed in 50-period ATR units and plotted as a negative value capped at 12.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code21
Settings0inputs
LicenceMPL-2.0
Last update8 weeks ago30 Aug 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

21 lines of Pine Script v6 from indicators/WebbyPctOff52WkHigh.pine, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.

WebbyPctOff52WkHigh.pine
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © peterdmv
//
// Recreation of Webby's ATR Off 52-Week High indicator (Mike Webster, IBD/O'Neil). Reimplemented for educational purposes.
//
// Release: v1

//@version=6
indicator("Webby's ATR Off 52-Week High", shorttitle="ATR Off 52W", overlay=false)

high52   = ta.highest(high, 252)
atr_off  = -math.min((high52 - low) / ta.atr(50), 12)

line_color = atr_off >= -4 ? color.green : atr_off >= -8 ? color.yellow : color.red

plot(atr_off, title="ATR Off 52W High", color=line_color, linewidth=2)

hline(0,   "52W High",          color=color.new(color.gray, 60), linestyle=hline.style_dotted)
hline(-4,  "Green Zone Floor",  color=color.green,               linestyle=hline.style_dashed)
hline(-8,  "Yellow Zone Floor", color=color.yellow,              linestyle=hline.style_dashed)
hline(-12, "Red Zone Floor",    color=color.red,                 linestyle=hline.style_dashed)

Overview

Webby's ATR Off 52-Week High draws that distance in a separate pane and colors the line green, yellow, or red using fixed thresholds at four, eight, and twelve ATR. Dashed horizontal lines mark zero and each zone floor. There are no user inputs, trade entries, or exit rules. The 252-bar lookback represents about one trading year of bars.

Details

Published by

peterdmv on GitHub

Type

Indicator, Pine Script v6

Draws

Separate pane below the chart

Category

Volatility & bands, Support & resistance

Markets

Stocks

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

CCI DC

by be-thomas
65 stars

This indicator plots the Commodity Channel Index in a separate pane and surrounds it with a Donchian channel whose lookback length changes with volatility. It measures volatility as a ratio of short and long ATR values, then ranks that ratio and shortens or le

Indicator v5 Oscillators & momentumVolatility & bands
Updated 4 days ago · GPL-3.0 GitHub repository of CCI DC

Trailing Drawdown

by palitojendthen
20 stars

The Trailing Drawdown indicator calculates and visualizes the percentage drop of a price series from its peak over a user-specified lookback period. It tracks maximum price levels within a rolling window and measures the current deviation from those peaks. Tra

Indicator v5 Volatility & bandsSupport & resistance
Updated 1 year ago · None stated GitHub repository of Trailing Drawdown

Market Pressure Scale plots two oscillator curves in a separate pane. Setup pressure combines ATR and Bollinger compression, support and resistance proximity, and drying volume. Impulse pressure combines range expansion, volume, and candle body size. A range-c

Indicator v6 Oscillators & momentumVolatility & bands
Updated yesterday · MIT GitHub repository of Market Pressure Scale [WavesUnchained]

QFA Pro Elite Refined

by JasonTeixeira
9 stars

This indicator plots a smoothed fear index in a separate pane. It measures how far the current low sits below the highest close over a lookback, scales that reading by an ATR percentile, and smooths it with a zero-lag EMA. A volatility regime raises or lowers

Indicator v6 Oscillators & momentumVolatility & bands
Updated 12 days ago · Custom licence GitHub repository of QFA Pro Elite Refined
7 stars

The Per Bak Self-Organized Criticality indicator calculates a composite fragility score by blending weights for tail risk from the SKEW index, volatility regimes from VIX terms, credit stress from HYG and LQD, and positioning from short volume data. It plots t

Indicator v5 Volatility & bandsSupport & resistance
Updated 3 months ago · None stated GitHub repository of Per Bak Self-Organized Criticality

MACD Breakout

by jerryinyang
5 stars

This indicator plots a higher-timeframe MACD breakout setup on the price chart and combines it with linear regression channels. It marks support and resistance zones from MACD histogram sensitivity, then filters them with the MACD zero line, a linear regressio

Indicator v4 Oscillators & momentumBreakout
Updated 2 years ago · None stated GitHub repository of MACD Breakout

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers