2005issue C021
Three-state moving-average directional breakout construction
Lock lookback-length, offset, source-series, and average type first, then classify each bar against a moving-average-baseline as a full-bar-breakout above, a full-bar-breakout below, or an overlap-state. Those states are written as a histogram-pair on a separate dual histogram, so the overlap case stays visible before any later out-of-sample comparison.
- Fix lookback-length, offset, source-series, and average type before any bar is classified against the moving-average-baseline.
- A full-bar-breakout is assigned only when the whole bar sits on one side of the baseline: the low above it, or the high below it.
- An overlap-state is kept as a mixed histogram-pair instead of a single-signed directional value.
- The study is a separate dual histogram with a zero baseline, and histogram colors stay independent of price-bar colors.
A baseline before a breakout state
A moving-average-baseline is a lookback smoother of an ordered price series used as the comparison level for a bar, not as a plotted price overlay.
Editorial reading: lock that baseline first, then classify each bar as fully above it, fully below it, or crossing it, so the overlap-state stays visible before any later out-of-sample comparison.
Lock the constructor first
Lookback-length is the number of sampling intervals used to compute the average. It is constructed with a minimum length of 1 bar and a documented default of 20.
The moving-average constructor also exposes an offset, documented with a default of 0.
The source-series is the price input fed into the average. It defaults to close and also allows high, low, open, or a multi-price composite.
The same lookback can be computed as a simple, exponential, weighted, or volume-weighted average, with the simple form as the default.
Classify each bar into one of three states
A full-bar-breakout is a state in which the entire bar sits on one side of the moving-average-baseline.
A bar is recorded as fully positive only when its low is above the moving average, and fully negative only when its high is below that average.
An overlap-state is a state in which the range of the bar crosses the moving average, so neither a full upside nor a full downside reading is assigned.
When the bar overlaps the average, the construction returns a mixed histogram-pair instead of a single-signed directional value. A histogram-pair is two signed histogram values that encode the directional state, including a split pair for the overlap case.
Show the states off the price pane
The study is built as a separate dual histogram with a zero baseline rather than as a price-pane overlay.
Histogram colors and price-bar colors are independent parameters for the positive, overlap, and negative states.
All readings on this track · 15 readings
- 1990Building a percent-difference moving-average oscillator
- 1991Ease of movement oscillator construction
- 1993A twelve-month moving-average filter for inflation direction
- 1993Constructing two-endpoint JSA moving averages
- 1999Centered moving averages for trend construction
- 2000Constructing a slope-corrected moving average
- 2000Lookback length as a construction check for the modified moving average
- 2001Smoothing balance of market power with a moving average
- 2005Three-state moving-average directional breakout construction
- 2005Constructing a move-adjusted moving average
- 2005Moving-average construction: windows, weights and stops
- 2008Constructing stacked moving-average filters
- 2011Constructing percentage-offset moving-average bands
- 2015Linearity, commutation, and ratio smoothing in moving averages
- 2019Constructing a 50-200 sma-channel for swing entries and exits