MTF and Repainting
This page exists because multi-timeframe tools, as a category, have a bad reputation — earned, in most cases, by products that quietly smuggle future information into a past bar, paint a picture that survives the back...
Written By Axiom Admin
Last updated 22 days ago
MTF and Repainting
This page exists because multi-timeframe tools, as a category, have a bad reputation — earned, in most cases, by products that quietly smuggle future information into a past bar, paint a picture that survives the backtest and does not survive live trading, and then blame the user when the live results disappoint. Axiom Stoch Osc CTX does not do that, but the mechanics of why it does not require some patience. This page is that patience, laid out in full.
Read this page if you run any slot at a timeframe higher than the chart, if you use Optional Ticker on any slot, if you use alerts on higher-timeframe slots, or if you want to trust the tool enough to act on it under pressure. Those are most readers of this trim.
The vocabulary this page uses carefully
Chart timeframe: the bars of the chart the indicator is attached to. Every alert and every clamp ultimately evaluates on confirmed chart bars.
Slot timeframe: the higher timeframe a specific slot evaluates its stochastic on.
"5"for five-minute,"60"for one-hour, etc. An empty slot timeframe means "same as the chart."Higher-timeframe bar: one bar of a slot's own timeframe. A 60-minute slot has one higher-timeframe bar per hour.
Confirmed value: a value computed on a bar that has closed. Once confirmed, it does not change.
Live value: a value computed on a bar that is still forming. It can change as the bar moves.
Repaint: a value that will be different the next time you look at the same bar. Live higher-timeframe values repaint by definition, because the bar they describe is not finished. A confirmed value does not repaint.
The on-bar-close switch: the per-slot
On Bar Close?setting. The slot's repaint gate. The centerpiece of this page.
The central tradeoff
Every higher-timeframe slot has a choice to make on every chart bar. Either the slot reports the live value of its currently-forming higher-timeframe bar — which is responsive but still moving — or it reports the confirmed previous value of its last-completed higher-timeframe bar — which is stable but lagged.
That choice is On Bar Close?:
On Bar Close? = true: the slot returns the previous confirmed higher-timeframe bar's K and D. These values do not repaint, at the cost of being one higher-timeframe bar behind whatever the live market is doing.On Bar Close? = false: the slot returns the live higher-timeframe bar's K and D. These values are immediately responsive, at the cost of changing as the higher-timeframe bar forms.
The switch is per slot. The K and D of a given slot share the switch — they cannot disagree on it — but different slots on the same pane can hold different choices. That asymmetry is deliberate. A reader can run a fast slot live for responsiveness on the near-term tape and a slow slot confirmed for safety on the regime-level read, on the same pane, at the same time. The pane ends up honestly mixed — part still, part moving — and the reader who understands which slot is on which side of the switch can read both views without confusion.
The switch is not a fix. There is no honest way to get both responsiveness and non-repainting behavior out of a higher-timeframe bar that has not closed yet. The physical situation is that the bar is still forming; the number describing "where this bar's source sits inside the bar's high/low range" literally cannot be final before the bar ends. Any tool that claims to deliver both properties is either hiding the movement (typically by returning the same stale number repeatedly and calling that non-repaint) or hiding the lag (typically by showing a live number and calling it confirmed). This switch does neither. It asks the reader to pick a side per slot, and it shows the reader which side they picked.
A reader who wants the switch to be a fix is, underneath, asking for the market to let them see a value that has not happened yet. The switch cannot deliver that. Nothing can. The sooner the switch stops being a disappointment — "why isn't this just fixing my problem?" — and starts being a tool — "which side of the tradeoff does each slot need to be on, given what I am using it for?" — the sooner the higher-timeframe surface becomes usable.
What each side of the switch looks like in practice
Picture a 1-minute chart, slot 03 at 60 minutes, on a symbol that is slowly rising through the first hour of the session.
With On Bar Close? on
At minute 1 through minute 59 of the first hour, slot 03 reports the K and D of the previous (just-closed) 60-minute bar. That value was set when the previous hour closed; it is stable for the next sixty minutes.
At minute 60 — as the current hour closes and a new one begins — slot 03 updates once, to the new previous-bar value.
If you reload the chart or refresh the page during the hour, slot 03's historical values do not change.
The slot line will look flat for long stretches on an intraday chart. That flatness is not the indicator freezing. It is the slot holding the confirmed previous-bar value until the next confirmation is available.
With On Bar Close? off
At minute 1 through minute 59, slot 03 reports the K and D of the current 60-minute bar, as it is forming. The value moves every chart bar as the current hour's price action accumulates.
At minute 60, the live bar becomes a confirmed bar and the next hour's live bar starts. Slot 03's last live reading and its first confirmed reading are, usually, close but not identical — and the difference between them is exactly the quantity the reader is absorbing when they look at a live higher-timeframe value.
If you reload the chart during the hour, the historical bars of slot 03 should be stable (they are computed from confirmed higher-timeframe bars). The slot's current reading can look slightly different across reloads, depending on where in the live higher-timeframe bar the reload lands.
The slot line will look more alive. That aliveness comes from reading values that will still change; it is exactly what the user asked for by turning the switch off.
A one-minute verification you should run once
Run this once, on a chart you trade regularly, with slot 03 at 60 minutes. It will teach you the switch in your own hands better than any reading of this page can.
Set
On Bar Close?on for slot 03. Wait for the top of the hour. Note slot 03's K value on minute 59 and minute 0 (just before and after the bar close). Expect: the value stays constant during the hour and then updates once at the top. The update is usually small but visible.Turn
On Bar Close?off for slot 03 and repeat. Watch slot 03 move continuously during the next hour. At the bar close, observe that the freshly confirmed value is close to but not identical to the last live reading you saw a second earlier.Reload the chart once during an hour under each setting. With the switch on, slot 03's historical values do not change. With the switch off, the slot's current value may look subtly different depending on exactly when in the hour you reloaded.
Having seen both sides, the switch stops being abstract. You have now watched the tradeoff with your own eyes.
The lookahead framing — what this script does and does not do
A reader who has seen other multi-timeframe tools may know the phrase "lookahead" from the TradingView API. It refers to a flag on higher-timeframe requests that changes whether the script is allowed to see — on a historical bar — the value of the higher-timeframe bar that contains that historical bar.
The honest framing:
Each slot's higher-timeframe request uses lookahead. That is a mechanical fact of the implementation. On a live bar, the request has access to the still-forming higher-timeframe bar; on a historical bar, it has access to the higher-timeframe bar that contained that historical chart bar.
What matters to the reader is the gate on top of the request.
On Bar Close?on returns the previous confirmed higher-timeframe bar instead of the value the lookahead would otherwise surface. The slot is non-repainting while the switch is on, because the previous bar's value is final and does not change with time.On Bar Close?off does not "turn off lookahead." It returns the lookahead-informed live value of the current higher-timeframe bar. That value will change as the bar forms — which is what most people mean by repainting.
This script uses lookahead and then gates the output per slot with a switch the reader controls. That combination is the entire reason the switch exists. Turning the switch on is not disabling a feature; it is choosing to read the confirmed previous bar over the live current one. Turning it off is not turning on a hack; it is choosing responsiveness over settled-ness. Both are legitimate. The mechanical detail — that lookahead is present on the request and that the switch gates what the slot exposes — is the piece most other multi-timeframe tools fail to surface, and a reader who understands this much already has a mental model that survives the kind of pane surprise most readers cannot articulate.
Cross-asset wrinkles — the Optional Ticker truth
Optional Ticker is the setting that reroutes a slot to another symbol entirely. It sits quietly in the per-slot section, easy to miss. The effect, however, is not quiet.
What Optional Ticker actually does
When you set Optional Ticker on a slot, the slot's stochastic context — all of it — is pulled from the chosen symbol. That includes:
The source. Whatever series you picked (close, open, a derived series) is now evaluated on the other symbol.
The high. The stochastic's upper reference of the recent range is the other symbol's high.
The low. The stochastic's lower reference of the recent range is the other symbol's low.
All three travel together. The slot is no longer "a stochastic of the chart symbol's close, smoothed with that slot's MAs." It is "a stochastic of the other symbol, smoothed with that slot's MAs." The same slot roster on the same pane can contain stochastics of completely different markets.
This is not a detail. It is a category change. A slot with Optional Ticker on an index is not "the chart symbol's stochastic, contextualized by the index." It is "the index's stochastic, sitting in the same pane as the chart symbol's stochastic and contributing to the same blend."
What this means for the blended pair
Once at least one slot has Optional Ticker set, the blended K and blended D are no longer a stochastic of the chart symbol. They are a weighted mixture of stochastic reads across different markets. That composite can be useful — a way to read an instrument in the context of a benchmark or a correlated partner — but it is not what most readers assume a composite of stochastics means the first time they see one.
The framing that holds every time this topic appears:
A blend with one or more cross-asset slots is a multi-market composite.
The composite is exactly as meaningful as the reader's reason for including the foreign slot.
Reading it as "my chart symbol's stochastic" is a category error. The pane will not correct the error; only the reader can.
Session wrinkles from Optional Ticker
Each symbol carries its own session calendar. TradingView uses that calendar when it serves higher-timeframe bars for the symbol. The consequence:
A slot with Optional Ticker on a 24-hour futures instrument sitting under a regular-session equity chart will keep updating outside equity hours.
A slot with Optional Ticker on a single-session equity under a 24-hour futures chart will freeze outside the equity's session. The slot's K will sit still during chart hours where the equity is not trading.
That frozen value is expected behavior. The slot cannot compute new stochastic from a market that is not producing new price data. Troubleshooting covers this as the "slot stuck at one value during active chart hours" symptom.
Interaction with On Bar Close? on a cross-asset slot
All of the switch's behavior described earlier still applies when Optional Ticker is set. The slot is returning either the previous confirmed higher-timeframe bar of the other symbol (switch on) or the live higher-timeframe bar of the other symbol (switch off). This compounds:
A cross-asset slot with
On Bar Close?on will be doubly restrained — it updates only when the other symbol's higher-timeframe bar closes, and it returns the previous completed bar's value rather than the live forming bar.A cross-asset slot with
On Bar Close?off moves according to the other symbol's live higher-timeframe bar, irrespective of the chart symbol's own activity.
The asymmetry here is useful. A reader running an equity chart with a slot on a broad futures index can hold the index slot on confirmed-previous-bar behavior to avoid its live bar noise while the equity's own slots run live for responsiveness. Deliberate choices of this kind are the entire reason the switch is per slot.
Session timing and the blended pair's behavior
One subtle property worth holding: every plotted line in this indicator updates on chart bars, regardless of what higher-timeframe bars are in play. The chart is what TradingView ticks the indicator on.
Consequences:
A 60-minute slot on a 1-minute chart evaluates its stochastic every minute, but its reported value only changes when a new piece of 60-minute information is available (a new live tick under switch off, or a new 60-minute close under switch on). The slot's line can step visibly across a 60-minute boundary when the switch is on.
The blended pair recomputes on every chart bar. Even if no slot's reported value changed this chart bar, the blended K and blended D are re-evaluated. That matters for alerting: state alerts on the blended pair are evaluated on every confirmed chart bar, even when the blended state has held for many bars.
Master smoothing (if enabled) is applied on the chart-bar time axis. It smooths the blended K and blended D over chart bars, not over higher-timeframe bars.
If any of those facts were going to be a surprise to you in a moment of pressure, the time to notice is before the pressure.
Warm-up on higher timeframes
A higher-timeframe slot needs enough higher-timeframe bars to fill its K Length before raw stochastic is non-NA. A 4-hour slot with K Length 14 needs roughly 14 higher-timeframe bars of history to warm up — about two and a half days of continuous 4-hour candles. During that first window, the slot has no usable K and cannot contribute to the blend or active counts. Once raw K exists, the script uses raw K while K smoothing catches up and uses K as D while D smoothing catches up, so early equality is possible before the usual K-versus-D separation appears.
Once the slot has warmed up, this ceases to matter on ordinary chart reloads, because TradingView preserves the higher-timeframe bar history. You only encounter warm-up again if you switch symbols, switch chart timeframes (in ways that cause the higher-timeframe history to be recomputed), or significantly adjust the slot's lengths.
A self-serve verification path you can trust
The pack's promise on this page is that the On Bar Close? switch is the repaint gate, and that the Optional-Ticker context travels as a unit. You should not take the pack's word for either. Run these four verifications once and you will have personally confirmed every load-bearing claim on the page.
Switch on, historical stability. With
On Bar Close?on for one higher-timeframe slot, reload the chart across several minutes. The slot's historical values do not change. Its current value updates only when its higher-timeframe bar closes.Switch off, live motion. With
On Bar Close?off for the same slot, watch the slot's current reading move during the higher-timeframe bar. At the bar close, the live value is replaced by a freshly confirmed value.Optional Ticker context. Set Optional Ticker on an otherwise-idle slot to a symbol with very different intraday range. Observe that the slot's K values are not simply "the chart symbol's K." They behave according to the other symbol's price movement.
Optional Ticker session. Choose a symbol with a session that does not overlap the chart's. During the chart's active hours but outside the other symbol's hours, the slot's K stays still. When the other symbol's session starts, the slot begins updating.
That is four minutes of work total. Nothing else on this page matters as much as having done those four things once.
What this page is not trying to do
It is not a fix for the general difficulty of reading live higher-timeframe values. No indicator can fix that problem.
On Bar Close?exposes the tradeoff; the reader chooses.It is not an argument that every slot should be on
On Bar Close?true. Responsiveness has a legitimate role. The choice is context-dependent.It is not a warning against Optional Ticker. Cross-asset slots have real uses — correlated-instrument reading, benchmark context, pair-trade-adjacent work. The pack is clear that Optional Ticker changes the meaning of the blend, and asks the reader to hold that change consciously.
It is not a replacement for Limitations and Trust Boundaries. The over-trust risks around repainting and around cross-asset composites live there.
Where to go next
For the knobs this page refers to throughout, return to Settings.
For the alert-volume consequences of
On Bar Close?on higher-timeframe slots, see Alerts.For symptoms that look like repaint behavior but are actually something else, see Troubleshooting.
For the mental model of the slot pipeline as a whole, including where the switch sits in the order of operations, see For the Geeks.