Skip to content
All library documents

Building an LSMA Standard-Deviation Band Oscillator

Article ProRealCode

Summary

This indicator design replaces the stochastic oscillator’s rolling high-low range with standard-deviation bands around a smoothed least-squares moving average. It computes a linear-regression endpoint, smooths it with an EMA, and adds and subtracts a volatility-scaled standard deviation of price. Price’s position within those bands becomes a 0–100 oscillator, with the regression line at the midpoint. The described defaults use a 21-bar regression, 4-bar smoothing, 32-bar deviation window, and multiplier of 2.9.

The panel maps each bar’s open, high, low, and close into oscillator space, adds color zones and reference levels, and uses a state machine for long-entry and exit markers. The proposed rationale is that statistical bands may be less distorted by a single extreme high or low than a stochastic range. However, the document supplies indicator logic and interpretation, not empirical comparisons, backtests, or evidence of profitability. Thresholds are configurable choices, and the suggested signals require independent testing before practical use.

Key ideas

  • The oscillator centers volatility bands on a smoothed linear-regression estimate of price.
  • It normalizes price within the bands to a 0–100 scale, with the regression axis at the midpoint.
  • Standard-deviation bands are intended to avoid the lasting influence of isolated high or low prices on a rolling range.
  • Mapped OHLC candles and colored zones show each bar’s position relative to the bands.
  • A state machine emits entry and exit markers only when the position state changes.
  • The document provides no backtest evidence that its thresholds or signals are profitable.

Tags

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