OPEN-SOURCE SCRIPT
A/D Line with Adaptive Strength Bands

This indicator analyzes the Accumulation/Distribution (A/D) line using a normalized linear regression slope over a rolling lookback period that can adjust automatically to the chart timeframe. The A/D line is built from price and volume, with each bar contributing positive or negative money flow depending on where the close falls within the bar’s range. The script then smooths the A/D line with an EMA and applies a linear regression to estimate its underlying trend.
A key feature of the script is its adaptive lookback. In Auto mode, the regression length adjusts by timeframe so the indicator remains responsive on intraday charts, balanced on daily charts, and not overly slow on weekly or monthly charts. In Manual mode, the user can set a fixed lookback length.
Rather than using the raw regression slope alone, the script normalizes the slope by dividing it by the standard deviation of the smoothed A/D line over the same lookback window. This is important because the A/D line is cumulative, so its raw values can become very large and are not directly comparable across different stocks, sectors, or timeframes. A raw slope that appears meaningful on one chart may be insignificant on another simply because the scale of the A/D line is different.
Normalization solves that problem by expressing the trend relative to the A/D line’s own recent variability. In other words, it shows whether the current slope is strong or weak compared with that stock’s normal behavior. This makes the indicator more informative than a simple endpoint comparison and more useful for comparing the strength of accumulation or distribution across various stocks.
The output is classified into bands such as Strong Accumulation, Accumulation, Neutral, Distribution, and Strong Distribution. The A/D line and its EMA are plotted as thin reference lines, while the regression slope line is highlighted to make the dominant money-flow trend easier to see. The result is a cleaner visual tool for identifying improving or weakening accumulation/distribution and for comparing relative money-flow strength across different securities.
A key feature of the script is its adaptive lookback. In Auto mode, the regression length adjusts by timeframe so the indicator remains responsive on intraday charts, balanced on daily charts, and not overly slow on weekly or monthly charts. In Manual mode, the user can set a fixed lookback length.
Rather than using the raw regression slope alone, the script normalizes the slope by dividing it by the standard deviation of the smoothed A/D line over the same lookback window. This is important because the A/D line is cumulative, so its raw values can become very large and are not directly comparable across different stocks, sectors, or timeframes. A raw slope that appears meaningful on one chart may be insignificant on another simply because the scale of the A/D line is different.
Normalization solves that problem by expressing the trend relative to the A/D line’s own recent variability. In other words, it shows whether the current slope is strong or weak compared with that stock’s normal behavior. This makes the indicator more informative than a simple endpoint comparison and more useful for comparing the strength of accumulation or distribution across various stocks.
The output is classified into bands such as Strong Accumulation, Accumulation, Neutral, Distribution, and Strong Distribution. The A/D line and its EMA are plotted as thin reference lines, while the regression slope line is highlighted to make the dominant money-flow trend easier to see. The result is a cleaner visual tool for identifying improving or weakening accumulation/distribution and for comparing relative money-flow strength across different securities.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.