OPEN-SOURCE SCRIPT
מעודכן

MA Distance (% and ATR) + Threshold Count

1 067
MA Distance (% & ATR) + Threshold Count
This script visualizes how far price is extended from key moving averages using both percentage and ATR-based distance. It includes a dynamic threshold system that tracks how unusually extended price is, based on historical volatility.

🔍 Features:
Calculates distance from:

10 EMA, 20 SMA, 50 SMA, 100 SMA, 200 SMA

Measures both:

% distance from each MA

ATR-multiple distance from each MA

Automatically calculates dynamic upper/lower thresholds using a rolling standard deviation

Plots a colored dot when distance exceeds these thresholds

Dots appear above or below the bar depending on direction

Color-coded summary table displays:

% distance

ATR distance

Threshold extremes

Total number of threshold hits

🎯 Customization:
Toggle which MAs to display in the table

Set your own lookback window and threshold sensitivity (via stdev multiplier)

Show/hide dots based on how many thresholds are hit

Use this tool to identify when price is overextended from its moving averages and approaching historically significant levels of deviation. Great for spotting mean reversion setups, parabolic runs, or deep pullbacks.
הערות שחרור
Updating Chart
הערות שחרור

  • Adding an option to show a background highlight when the price is within a defined normal range
  • Adding debug labels to show which MA thresholds are being hit


כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.