A Moving Average (MA) Stack evaluates the relative alignment and spatial geometry of three short-to-medium-term trend baselines: the 5-day, 10-day, and 20-day moving averages. Rather than tracking price relative to a single line, the MA Stack engine measures how these three moving averages sit relative to one another.
The three averages start together and fan apart as a move runs. AAPL's stack reads in order, 5-day highest, then 10-day, then 20-day, with the 5-day sitting 1.68% above the 10-day and the 10-day 4.42% above the 20-day.
Two dimensions of stack geometry
The arrangement of a moving average stack conveys two vital structural characteristics simultaneously:
Order (directional hierarchy): determines which average sits on top. When fast averages sit above slower averages (5-day > 10-day > 20-day), recent price velocity is outperforming older performance, confirming a strong bullish trend structure.
Spacing (dispersion & fan): quantifies the mathematical distance between each average pair.
Bunched averages: indicate low volatility, consolidation, or a quiet, directionless market.
Fanned averages: indicate an extended, high-momentum price move that has expanded away from equilibrium.
Practical example (Apple Inc., AAPL)
5-day vs. 10-day distance: +1.68% (the 5-day sits 1.68% above the 10-day).
10-day vs. 20-day distance: +4.42% (the 10-day sits 4.42% above the 20-day).
Because all faster lines sit comfortably above slower lines with healthy spacing, AAPL exhibits a textbook, fanned-out rising stack.
The stack is actively rolling over or turning around.
Why three gaps are required
Measuring only two internal gaps leaves the total outer spread ambiguous. Incorporating the 5↔20 outer gap locks down both the internal hierarchy and the overall boundary expansion of all three lines simultaneously, ensuring historical matches reflect today's exact chart setup.
Analyzing stacks in transition (Meta Platforms, META)
5↔10 gap: −1.07% (the 5-day has dropped below the 10-day).
10↔20 gap: +5.99% (the 10-day remains significantly above the 20-day).
On META the 5-day has slipped just below the 10-day while the 10-day still sits far above the 20-day. The front pair has crossed, the back pair is still wide, which is what a stack looks like part way through a turn.
Core Insight
META's stack is part way through turning over. The front of the stack (5↔10) has rolled over into a short-term pullback, while the back of the stack (10↔20) remains widely fanned out from the prior rally.
Chapter 3
Multi-Gap Historical Matching & Sample Density
To find historical precedent, the engine converts all three gaps into percentile rankings against that ticker's own history. A historical trading day qualifies as a match only when all three gap rankings sit close to today's values.
Match Qualification = Gap 1 match AND Gap 2 match AND Gap 3 match
Meeting two out of three gap conditions is not sufficient to qualify.
Common vs. rare stack geometry
A common, trend-aligned stack shows up often, so its matched set is large and sits close to today's arrangement. A rare, half-turned shape has few lookalikes in the record, and the ones it has are less alike, so its forward numbers deserve more caution.
Standard arrangements (e.g., AAPL): common, trend-aligned stacks occur frequently across history, yielding a dense sample with many close historical comparisons.
Complex / transitioning arrangements (e.g., META): a half-rolled-over stack is rare for a specific asset, so there are fewer historical days that look like it, and the ones that do are less alike. A transition setup is a looser comparison, and its forward numbers deserve more caution.
Order vs. spacing: why order alone is incomplete
Two assets can both exhibit a "rising stack" order (5-day > 10-day > 20-day) while representing completely opposite risk/reward profiles:
Setup A (bunched stack): averages are separated by fractions of a percent after a 2-week consolidation. Volatility is compressed, signaling a potential breakout expansion.
Setup B (fanned stack): averages are separated by wide percentage spreads following an explosive 3-week rally. Volatility is expanded, signaling an overextended move susceptible to mean reversion.
Core Backtesting Rule
The backtesting engine treats Setup A and Setup B as completely different structural setups because it matches on exact percentage spacing, rather than line order alone.
Chapter 4
Price Projections
The engine projects across three fixed horizons: the next trading day, one week (5 trading days) and one month (21 trading days). Every card shows the exact future date it refers to, so there is no ambiguity about which session is being measured.
Three measures on each card
Green / red odds: the split between matched days that closed higher and those that closed lower over that horizon.
Avg green return: the average gain of only the matched days that closed higher.
Avg red return: the average loss of only the matched days that closed lower.
AAPL's read from that rising stack:
Horizon
Target date
Odds
Avg green
Avg red
Next day
23 July 2026
64% / 36%
+1.72%
−1.36%
One week
29 July 2026
63% / 37%
+3.16%
−2.43%
One month
21 August 2026
60% / 40%
+9.25%
−5.10%
Measured on AAPL, 22 July 2026, from 76 matched days.
Always read the averages next to the odds
The two average rows are one-sided: avg green averages only the up outcomes, avg red only the down outcomes. Never read them by themselves.
The month row leans green on both counts: 60% of those months closed higher, and the average gain (+9.25%) was larger than the average loss (−5.10%). When the odds and the averages point the same way the read is clean; it is the rows where they disagree that need the closer look.
Chapter 5
The Three Charts
One Chart View toggle, three ways of looking at the same sample of matched days: the Price Cone, the Bar Graph and the Chart Log.
1. Price Cone
The default. It projects forward 45 sessions from today's price, drawing the percentile bands of what the matched days actually did, converted into prices.
Median line (50th percentile): the central outcome of the sample, not a target.
Cone width (10th to 90th): how much the matched days disagreed. A narrow cone means consistent outcomes; a wide one means high variance.
2. Bar Graph
This asks a different question: how often did price travel a set distance, and how quickly? You choose the move size, and the chart answers in both directions at once. Green bars above the line show the share of matched days that rose that far within a given number of days; red bars below show the share that fell that far.
By Touch vs By Close
Setting
What counts
Use it for
By Touch
Any intraday high or low that reached the level, even if price came back before the close
Path risk: stop-loss triggers or intraday margin
By Close
Only a daily close beyond the level
Settlement risk: holding-period targets or trend sustainability
Touch numbers are always equal to or higher than close numbers. A wide gap between the two flags heavy intraday movement that did not hold into the close.
3. Chart Log and the event register
The Chart Log shows the full price chart with every matched day marked, so you can see the wider context each time the same setup appeared. Below it, the event register lists every matched day with its date, its three gaps, and its forward return.
Any column sorts, which makes it easy to find the largest gains and worst drawdowns in the sample. Those extremes often matter more than the average when you are sizing a position.
The front page runs the same analysis across every ticker at once, so you can scan the day's arrangements without opening them one at a time.
Every ticker has a reading
There is no trigger here. Every stock's averages sit in some arrangement every day, so every row carries a number. The question is never whether a ticker qualifies, only what shape its stack is in.
The MA Positioning column
One cell, all three gaps: 5↔10, 10↔20 and 5↔20, each signed. Read the signs first for the order, then the sizes for how stretched it is. A row where the first gap disagrees in sign with the other two is a stack in the middle of turning.
Price Projections
The same price projections from Chapter 4 appear here: avg green, avg red, and the odds, shown for next day, next week and next month.
Each figure is calculated from that ticker's own matched days. The numbers are therefore not comparable side to side in the way they look. Two rows both showing 64% are each describing their own stock.
Every column sorts. Sorting on the positioning column groups the widest stacks together, which is the fastest way to find the names that have been running hardest.