OPEN-SOURCE SCRIPT
MHIDa ATR-Distance Dip

WHAT IT DOES
ATR-Distance Dip is a visual context tool that measures how far price has stretched BELOW a reference moving average - not in fixed percentage points, but in ATR units (units of volatility). The same setting adapts by itself: in a calm market a small move already counts as far, in a choppy market price must travel further before it counts.
It draws:
- The reference average (EMA, default 20).
- A dynamic threshold line at (average - N x ATR), default N = 3.5.
- A shaded stretch zone between the average and the threshold.
- A small triangle when the previous bar closed below the threshold and the current bar closes back up (the first comeback candle after the drop).
- An optional alert on that comeback event, so you can be notified to LOOK at the chart.
HOW IT IS CALCULATED
- average = EMA(close, 20)
- ATR = simple moving average of the True Range over 14 bars (a plain SMA of the true range, not Wilder's smoothing)
- threshold = average - N x ATR (N adjustable, default 3.5; a sensible exploratory range is 2.5 / 3.5 / 4.5)
- highlight condition (evaluated on closed bars): previous close below the previous threshold AND current close above the previous close.
WHY ATR INSTEAD OF A FIXED PERCENTAGE
A fixed distance like 5% below the average means different things in quiet and in volatile regimes. Measuring the stretch in ATR units keeps the meaning consistent: 3.5 ATR below the average is unusually stretched both in slow and in fast markets, because the yardstick itself follows current volatility.
HOW TO USE IT
Add it to a standard candlestick chart. Watch the shaded zone: when price falls below the threshold line, the market is unusually stretched below its average for the current volatility regime. The triangle marks only the first attempt to come back (a close above the previous close), which is where a chart reader may want to start paying attention. Adjust the average length, the ATR length and the multiple to your instrument and timeframe: the defaults are a starting point, not the one true configuration.
HONESTY NOTE
This is a context and chart-reading aid, not a trading system: it issues no entries, no exits and simulates no trades. Directional markers are drawn only on standard chart types. It is not financial advice. You always decide.
ATR-Distance Dip is a visual context tool that measures how far price has stretched BELOW a reference moving average - not in fixed percentage points, but in ATR units (units of volatility). The same setting adapts by itself: in a calm market a small move already counts as far, in a choppy market price must travel further before it counts.
It draws:
- The reference average (EMA, default 20).
- A dynamic threshold line at (average - N x ATR), default N = 3.5.
- A shaded stretch zone between the average and the threshold.
- A small triangle when the previous bar closed below the threshold and the current bar closes back up (the first comeback candle after the drop).
- An optional alert on that comeback event, so you can be notified to LOOK at the chart.
HOW IT IS CALCULATED
- average = EMA(close, 20)
- ATR = simple moving average of the True Range over 14 bars (a plain SMA of the true range, not Wilder's smoothing)
- threshold = average - N x ATR (N adjustable, default 3.5; a sensible exploratory range is 2.5 / 3.5 / 4.5)
- highlight condition (evaluated on closed bars): previous close below the previous threshold AND current close above the previous close.
WHY ATR INSTEAD OF A FIXED PERCENTAGE
A fixed distance like 5% below the average means different things in quiet and in volatile regimes. Measuring the stretch in ATR units keeps the meaning consistent: 3.5 ATR below the average is unusually stretched both in slow and in fast markets, because the yardstick itself follows current volatility.
HOW TO USE IT
Add it to a standard candlestick chart. Watch the shaded zone: when price falls below the threshold line, the market is unusually stretched below its average for the current volatility regime. The triangle marks only the first attempt to come back (a close above the previous close), which is where a chart reader may want to start paying attention. Adjust the average length, the ATR length and the multiple to your instrument and timeframe: the defaults are a starting point, not the one true configuration.
HONESTY NOTE
This is a context and chart-reading aid, not a trading system: it issues no entries, no exits and simulates no trades. Directional markers are drawn only on standard chart types. It is not financial advice. You always decide.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.