TL;DR. The 5-bar simple average of each bar's midpoint minus the 34-bar one. Bars above zero mean recent midpoints sit above the longer run's; growing bars mean momentum is building.
What it measures
- Short against long. Like a MACD built from simple averages of the bar's midpoint instead of exponential averages of the close.
- Where the bar's centre sits. The midpoint
(high + low) / 2ignores where the bar closed, so AO reads the range's drift, not the last print. - Price units. The difference of two averages, in points, so thresholds are per instrument.
Formula
Inputs in AlgoLift
| Setting | Default | Range | Notes |
|---|---|---|---|
| Fast period | 5 | 1 to 500 | Bars in the short average of the midpoint. |
| Slow period | 34 | 1 to 500 | Bars in the long average. The two swap if slow is the shorter. |
AO always reads the bar's midpoint; it has no Source setting.
Outputs in AlgoLift
| Handle | Type | Plotted | Notes |
|---|---|---|---|
| AO | Numeric | Always | The short average minus the long one, in price units, drawn as a histogram around zero. |
How to read it
- Above zero: recent midpoints are above the longer run's. The short-term drift is up.
- Below zero: the mirror.
- Zero-line cross: the two averages cross. The classic AO signal.
- Growing or shrinking bars: each bar against the one before it tells you whether the gap is widening (momentum building) or narrowing (fading).
Best in, worst in
Best in swinging markets with clear legs, where the histogram's growth and shrink line up with the legs.
Worst in flat chop, where the two short averages tangle around each other and the zero line is crossed again and again.
Three setups
1. Zero-line cross
A Crossover of AO above 0 enters long, below 0 enters short. Add a Set Stop Loss so a failed cross does not ride.
2. Momentum filter for another trigger
Gate a breakout entry with a Comparison that AO is above 0 for longs, below 0 for shorts.
3. Fading histogram exit
Exit a long with Set Exit Condition when AO is below its value one bar ago (through a Bars Ago modifier) for two bars running: the up-drift is losing speed.
Common mistakes
- Expecting it to read the close. AO uses the midpoint, so a bar that closes at its high still counts its middle.
- Copying thresholds between instruments. AO is in points. Compare it with 0 or with its own recent values, not with a fixed number from another market.
- Treating every bar colour change as a signal. The bar-to-bar change flips often; require more than one bar.
AO is a midpoint moving-average gap drawn as a histogram: its zero cross is the crossover, its bars show whether the gap is opening or closing.