For the Geeks
This page is for readers who want to understand how the indicator works under the hood — not just what it shows, but why the mechanics produce the behavior they do. You do not need this page to use Axiom MA Pro. But i...
Written By Axiom Admin
Last updated About 1 month ago
For the Geeks
This page is for readers who want to understand how the indicator works under the hood — not just what it shows, but why the mechanics produce the behavior they do. You do not need this page to use Axiom MA Pro. But if you have noticed the blend behaving in a way you cannot explain from the Settings page alone, or if you want to build better intuition about edge cases, this is where those explanations live.
This page explains three distinctive mechanics:
Each section includes a verification path — a way to confirm the behavior on a live chart yourself.
How the blend is calculated
The Blended MA is often treated as "the average of the MAs." That is close, but it misses two things that matter: the blend is a weighted average, and the blend's trend is determined separately from the blend's value.
The blend value
The blend value — where the blended line sits vertically on the chart — is a normalized weighted average of the enabled slots' MA values.
Here is the logic in plain language:
Look at every enabled slot that has a non-zero weight and a valid MA value.
Multiply each slot's MA value by its weight.
Add up all those weighted values.
Divide by the total weight.
The result is the blended value. Slots with higher weight pull the blend closer. Slots with weight zero are excluded entirely — they do not contribute to the numerator or the denominator.
Why normalization matters: Because the weights do not need to sum to 100, the indicator divides by the actual total weight to get a proper average. Weights of 33.3/33.3/33.3 produce the same blend position as weights of 1/1/1 or 200/200/200. The ratio matters, not the absolute values.
Important caveat: The intuitive "the blend stays somewhere between the contributing lines" rule assumes non-negative weights. The current script does not clamp negative inputs, so if you enter them, the blend can leave the visible slot range and the vote becomes harder to reason about.
What this means in practice: If you have three slots and you change one from weight 33 to weight 66, you have doubled that slot's share of the blend. The blend pulls toward that slot. You have not changed anything about the other two slots, but you have changed how much the blend listens to them relative to the heavier one.
The blend trend
The blend's trend color — lime for uptrend, red for downtrend — is determined by a weighted vote, not by the direction of the blend value.
Here is the logic:
Look at every enabled slot that has a non-zero weight and a valid MA value.
Check each slot's individual trend state (uptrend or downtrend).
Add that slot's weight to the uptrend pile or the downtrend pile.
Compare the two piles. The side with more weight wins.
If the piles are exactly equal, uptrend wins.
Why the trend is separate from the value: The blend value is a weighted average of MA positions. The blend trend is a weighted average of MA directions. These are different things. The blend value can be rising (because the higher-positioned MAs have more weight) while the trend vote says downtrend (because the slots that are actually falling carry more weight). This sounds contradictory, but it reflects a real situation: the heavier MAs are positioned higher but declining, while the lighter MAs are positioned lower but rising.
When you see the blend line moving one direction while its color says the opposite, this is the value and the vote disagreeing. It usually means the stack is in transition.
Why not use a simple average?
A simple average treats all slots equally. If you have a 5-minute slot and a daily slot, a simple average gives the 5-minute intraday wiggle the same influence as the daily structural trend. The weighted approach lets you decide how much each level matters to the summary.
A simple majority vote (unweighted) would let one slot with a tiny weight override a slot with a large weight. If you have a monitoring slot at 5% weight and a primary structural slot at 60% weight, you probably do not want the monitoring slot to have an equal say in the trend vote. The weighted vote respects the priority you assigned.
Verification: blend value
Enable only Slot 01 and Slot 02. Set both to weight 50.
Observe the blend. It should sit midway between the two slot lines.
Change Slot 01 to weight 90 and Slot 02 to weight 10. The blend should pull heavily toward Slot 01.
Set Slot 02 to weight 0. The blend should now track Slot 01 exactly, because Slot 02 is excluded from the calculation.
Re-enable Slot 02 at weight 50. The blend shifts back toward the midpoint.
Verification: blend trend vote
Enable two slots with equal weight. Find a moment where they disagree on trend (one bright, one dim).
The blend's color should reflect the slot whose weight equals the other — with equal weight and one up, one down, the tie goes to uptrend (lime).
Increase the downtrend slot's weight until it exceeds the uptrend slot's weight. The blend color should flip to red.
This confirms the weighted vote behavior: the side with more weight wins.
How cross-ticker scaling works
When you set a slot's optional ticker to a different symbol, the MA is computed on that symbol's data. But the resulting value lives in the foreign symbol's price space. If the chart shows AAPL at $200 and the foreign ticker is SPY at $500, plotting a raw SPY MA at $500 on an AAPL chart is visually meaningless.
The indicator solves this with a price-ratio projection.
The projection logic
Fetch the chart symbol's close on the slot's configured timeframe.
Fetch the foreign ticker's close on the same timeframe, using the same confirmation mode (On Bar Close).
Compute a ratio: chart close divided by foreign close.
Multiply the foreign MA value by that ratio.
When that ratio is available, the result is a price value in the chart's price space. It represents "where the foreign MA would sit if the two symbols were on the same scale." If the ratio cannot be computed because one side lacks usable data at that timeframe, the script leaves the foreign MA unscaled instead.
Why a live ratio instead of a fixed one
The ratio is recalculated on each bar. This means the projection adapts as the relative prices of the two symbols change over time. If AAPL appreciates relative to SPY, the ratio shifts and the projected MA adjusts accordingly.
A fixed historical ratio would drift over time as relative prices change, eventually producing a projection that is badly misaligned. The live ratio prevents that.
The tradeoff: the live ratio introduces its own source of movement. The projected MA can shift not because the foreign MA changed, but because the ratio changed. During periods when the two symbols diverge quickly, the ratio changes faster than the MA, and the projected value can overshoot or undershoot where a native MA on the foreign chart would sit.
What "approximate" means in practice
During normal conditions — when the two symbols are moving in roughly the same direction or the ratio is stable — the projection is close enough to be useful. The foreign MA tracks at a plausible level on the chart.
During sharp divergences — when one symbol rallies while the other drops, or one gaps while the other does not — the projection drifts. The scaled MA may sit at a level that no longer corresponds well to the foreign MA's actual position on its own chart.
This drift is inherent in any single-ratio projection method. It is not a bug. It is a consequence of compressing a complex relationship (the relative performance of two assets over time) into a single number (the current bar's close ratio). A more sophisticated method could use a rolling ratio or a regression, but those introduce their own lag and complexity tradeoffs. The single-bar ratio is the simplest approach that adapts at all, and its behavior is easy to reason about: when the two symbols move together, the projection tracks well; when they diverge, it drifts; and the drift corrects as the ratio recalibrates.
What to do when you notice drift: If the cross-ticker MA line on your chart is sitting at a level that does not make sense — noticeably above or below where you would expect based on the foreign symbol's actual trend — open a separate chart of the foreign symbol and check the native MA directly. The drift tells you the two symbols have diverged, which is useful information on its own. But do not make decisions based on the exact level of a drifting projection.
Verification: cross-ticker scaling
Enable Slot 04 with an optional ticker set to a different symbol (e.g., SPY if you are charting QQQ).
Set a specific timeframe, MA type, and length (e.g., daily SMA 20).
The slot's line should appear near the chart's price level, not at the foreign symbol's absolute price level.
Open a separate chart of the foreign symbol. Add a standard SMA 20 on the same timeframe.
Compare the two visually. They should track each other roughly but not exactly. The Axiom MA Pro version is projected; the standalone version is native. Small discrepancies are expected and reflect the ratio projection.
During a period when the two symbols diverge sharply, the discrepancy will grow. This is the drift in action.
How trend detection works
Each slot determines its own trend direction using a self-comparison method. This is different from both price-vs-MA comparisons and dual-MA crossovers.
The comparison
The slot compares its current MA value to the MA value from N bars ago, where N is the slot's configured trend length. The comparison happens on the slot's timeframe bars.
If the current MA is greater than or equal to the MA from N bars ago: uptrend.
If the current MA is strictly less than the MA from N bars ago: downtrend.
That is the entire logic.
Why "greater than or equal to"
The "or equal to" part means that a flat MA — one that has not moved at all over the lookback window — reads as uptrend.
This is a deliberate design choice. Without the "or equal to," a perfectly flat MA would oscillate between uptrend and downtrend based on floating-point rounding or minimal sub-cent movements. During consolidation, the slot's color would flicker constantly, producing visual noise that does not represent meaningful directional change.
With the "or equal to," a flat MA holds its uptrend color through consolidation. The cost is that the slot can register as uptrend during periods when no real directional bias exists. This is a tradeoff: stability during chop vs. precision about the absence of a trend.
If you notice a slot showing uptrend (bright color) during an obviously sideways market, this is why. The MA has not declined — it has gone nowhere — and "not declined" qualifies as uptrend under this definition.
Why self-comparison instead of price-vs-MA
A price-vs-MA comparison (is price above or below the MA?) is noisy. Individual candles can cross above and below the MA multiple times in a session, producing constant trend flips that reflect bar-level volatility rather than directional change.
The self-comparison method asks "has the average itself changed direction?" rather than "is today's price on the right side of the average?" This produces a smoother, more structural trend reading. The MA is already a smoothed version of price — comparing it to itself at a lag reads the direction of the smoothed line rather than reacting to every time price wiggles across it. The result is a trend signal that changes only when the moving average itself has sustained a direction change over the lookback window.
Why self-comparison instead of dual-MA crossover
A dual-MA crossover (fast MA crosses above slow MA) requires managing a second length parameter per slot — a fast length and a slow length. With ten slots, that would be twenty length parameters before counting any other settings. The self-comparison approach keeps each slot self-contained: one MA, one trend length, one trend state. No secondary MA needed.
How trend length changes the behavior
Short trend length (1–2): Very sensitive. The slot detects direction changes quickly but also reacts to minor noise. On fast timeframes with short trend lengths, expect frequent color flips.
Medium trend length (3–5): The default range. Catches genuine direction changes within a few bars on the slot's timeframe. Ignores most single-bar noise.
Long trend length (7+): Very conservative. The slot holds its trend color through minor pullbacks and consolidations. Only flips when the direction change is sustained. The cost is delayed response to genuine reversals.
Trend length 0: The current script does not disable trend here. It forces the slot's trend boolean to false, so once the slot has a value it behaves as downtrend in color, alignment, alerts, and any non-zero blend vote.
Verification: self-comparison trend detection
Set a slot with trend length 3 on a timeframe where you can observe the MA over multiple bars.
Find a period where the MA was flat or slowly declining for several bars.
Observe the trend color. If the MA was flat, the color should be the uptrend shade (bright). If the MA was slowly declining, it should be the downtrend shade (dim).
Increase the trend length to 7. Watch whether the trend color changes. A longer lookback window may reach a period where the MA was higher, flipping the trend from uptrend to downtrend even though the MA's recent behavior has not changed.
Decrease the trend length to 1. Watch how frequently the color flips. On a fast timeframe with a 1-bar lookback, every bar where the MA ticks down produces a downtrend flash.
This hands-on test is the fastest way to build intuition for how the trend length setting shapes the slot's directional reading.
What this page does not cover
This page explains the mechanics in enough depth to understand and verify the behavior. It does not reproduce the implementation. The specific code patterns, array structures, fallback conditions, and iteration methods are not described here. The goal is to help you reason about the indicator's behavior — not to provide enough detail to clone it.
The verification paths above are the bridge between the explanation and your own experience. If you run the steps and get the expected results, you can trust that the mechanics work as described. If you find a behavior that does not match, check Troubleshooting first. If the behavior is genuinely inconsistent with what is described here, it may be a version-specific change or a case worth reporting.