Skip to content
All library documents

Deviation Trend Profile: SMA Turns, ATR Bands, and Close Distribution

Article ProRealCode

Summary

The Deviation Trend Profile combines a simple moving average (SMA), ATR-scaled bands, trend-turn markers, and a histogram of closing prices. It calculates an SMA and a 200-bar ATR, then plots three deviation levels above and below the average using configurable ATR multiples. A normalized change in the SMA, measured against ATR, marks a bullish turn when it crosses above 0.1 and a bearish turn when it crosses below −0.1. The default SMA length is 50, and the profile uses 50 bins.

After a trend change, the indicator groups closes into price bins spanning the outer deviation levels and draws a side profile to show where closes have accumulated. These concentrations may help visualize possible support or resistance areas, while wider deviations show price expansion relative to the average. The document explains the calculations and supplies ProBuilder code, but reports no tested results. The code and prose also differ in aspects of binning and transparency, so the displayed profile should be checked against the intended calculation before interpretation.

Key ideas

  • The indicator combines an SMA trend measure with bands scaled by ATR.
  • It marks trend changes when normalized SMA momentum crosses positive or negative thresholds.
  • A histogram groups closing prices since the latest trend change within the outer deviation range.
  • Profile concentrations may suggest areas to watch, but the document does not validate them as support or resistance.
  • The supplied explanation and code differ in details of the histogram calculation.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.