MTF and Repainting

If you use this oscillator on any timeframe higher than the chart timeframe — which is the entire point of a multi-timeframe tool — you need to understand what "higher-timeframe data" means in practice and what the On...

Written By Axiom Admin

Last updated About 1 month ago

MTF and Repainting

If you use this oscillator on any timeframe higher than the chart timeframe — which is the entire point of a multi-timeframe tool — you need to understand what "higher-timeframe data" means in practice and what the On Bar Close toggle actually controls. This page covers both in enough depth that you can make an informed choice instead of guessing.


What "higher-timeframe data" means in this oscillator

Each slot can run its stochastic calculation on a timeframe higher than the chart. If your chart is on 1-minute and Stoch 03 is set to 60-minute, the indicator asks TradingView's data infrastructure for the stochastic result at the 60-minute level. That result represents a stochastic calculation — where price closed relative to the high-low range — run across 60-minute bars, not 1-minute bars.

The issue is timing. The 60-minute bar takes an hour to complete. During that hour, on a 1-minute chart, you will see 60 chart bars update while the 60-minute bar is still building. The question is: what should the slot show during those 60 bars?

There are two honest answers, and they conflict:

  1. Show the last completed 60-minute bar's stochastic. This is stable. The value will not change until the next hourly bar closes. What you see live matches what the chart will show in history. The cost: you are looking at data that is up to 59 minutes old.

  1. Show the current building 60-minute bar's stochastic. This is fresh. The value updates on every chart-timeframe tick, giving you the best available estimate of the 60-minute stochastic right now. The cost: the value can change on every tick, and once the hourly bar closes and the final value is calculated, the historical chart may show something different from what you saw live.

The first is the non-repainting answer. The second is the repainting-by-design answer. The On Bar Close toggle lets you choose between them.


On Bar Close: ON (the default)

When On Bar Close is on, each slot uses the previous fully confirmed higher-timeframe bar's stochastic K and D values. The indicator deliberately looks one HTF bar back to ensure it is reporting finalized data.

What this means in practice:

  • The slot's K value does not change between HTF bar closes. On a 1-minute chart with a 60-minute slot, the slot line holds flat for up to 60 minutes, then updates in a single step when the new hourly bar closes.

  • Historical bars and live bars show the same values. If you scroll back to yesterday's chart, the readings you see are what you would have seen if you had been watching live at the time.

  • There is no "gotcha" moment where the display shifts after a bar closes. What you see is what you get.

The tradeoff:

Stability costs timeliness. The slot always lags by up to one HTF bar. If the 60-minute bar just opened and the market immediately reversed, the 60-minute slot will not reflect that reversal for up to 59 more minutes. The slot is correct — it is reporting the last confirmed state — but it is not current.

This lag is real and affects the blend. If two of three slots use higher timeframes, their lagged data feeds into the weighted average. The blend will be slower to react than the fastest slot, partly because of the smoothing and partly because the higher-timeframe inputs are behind.

When to use this mode: whenever you need the display to be trustworthy in retrospect. If you are going to look at this oscillator later and ask "what was the reading at 10:30 AM?" the On Bar Close ON mode gives you a reliable answer. This is the default for good reason.


On Bar Close: OFF

When On Bar Close is off, each slot uses the current building higher-timeframe bar's stochastic K and D values. The slot updates on every chart-timeframe tick with the best available estimate of the HTF stochastic.

What this means in practice:

  • The slot's K value changes continuously while the HTF bar is open. On a 1-minute chart with a 60-minute slot, you will see the slot line move on every minute bar as the building hourly stochastic recalculates.

  • The display is more responsive. You see the emerging state of the higher-timeframe stochastic in real time instead of waiting for the bar to close.

  • The live display may not match the historical record. Once the HTF bar closes and the final stochastic value is computed, the bar's canonical value may differ from what you saw at any given tick during the bar. If you scroll back to that period tomorrow, you will see the final value, not the intermediate one you acted on.

Why this is called repainting:

"Repainting" means the indicator's display changes retroactively. What looked like a bullish reading at 10:15 may look bearish at 10:59 when the hourly bar closes and the final stochastic value differs from the in-progress estimate. The indicator did not lie — it showed the best available data at each moment — but the display you saw and the display the chart records are different.

When this matters:

  • If you made a decision at 10:15 based on the slot reading, and the bar closes at 11:00 with a different final value, the chart will not preserve the reading you acted on. In hindsight, it will look like the oscillator showed something different from what you saw.

  • If you use screenshots or visual backtesting, the historical chart after bar close will not match what the live display showed during the bar.

  • If you are trying to build confidence in the tool by comparing live readings to historical behavior, the repainting mode makes that comparison unreliable.

When to use this mode: when you specifically need intrabar awareness of higher-timeframe stochastic momentum and you understand that the display is provisional. Some traders use it for real-time monitoring during active sessions, with the discipline to treat every reading as "current best estimate, not settled fact." If that discipline is not natural to you, leave this off.


How to verify which mode you are in

If you are not sure whether On Bar Close is on or off, here is a simple test:

  1. Apply the indicator to a 1-minute chart with at least one slot set to a higher timeframe (e.g., 5-minute or 15-minute).

  2. Watch the higher-timeframe slot line during a period when the chart is actively ticking.

  3. If the line holds perfectly flat between the HTF bar closes and then jumps: On Bar Close is on. The slot is waiting for confirmed data.

  4. If the line moves on every chart-timeframe bar: On Bar Close is off. The slot is tracking the building HTF bar.

You can also check the indicator settings — On Bar Close is in the Power User Settings group.


How this affects the blend

The On Bar Close setting applies globally. All slots use the same mode. This means the blend inherits the timing characteristics of its inputs:

  • On Bar Close ON: the blend updates only when one of its contributing HTF slots updates (i.e., when an HTF bar closes). Between closes, the blend reflects the chart-timeframe slot's changes plus the frozen HTF values. With three slots on 5/15/60 and a 1-minute chart, the blend recalculates every minute based on the 5-minute slot's last confirmed value plus whatever the 15-minute and 60-minute slots last confirmed. Those two higher-timeframe slots may hold stale data for minutes or the better part of an hour. The blend is always a mixture of fresh and confirmed data, and the proportion shifts as bar closes arrive.

  • On Bar Close OFF: the blend updates continuously as all slots update intrabar. The blend is more responsive but also more volatile, and it carries the same repainting risk — the blended values you see mid-bar may differ from the final values after all HTF bars close. The blend will look more alive, but every value it shows between bar closes is provisional.


The stochastic runs inside the HTF context

An important detail about how the calculation works: the stochastic math — ta.stoch(), the K smoothing, and the D smoothing — all run inside the higher-timeframe data context. The indicator does not take chart-timeframe data and project it upward. It requests the stochastic result as if a standalone indicator were running on the higher-timeframe chart.

The practical consequence: the slot's reading is computed as if it were a standalone stochastic indicator on that timeframe. The K Length, K Smoothing, and D Length all operate on the higher-timeframe bar series. A K Length of 14 on a 60-minute slot means 14 sixty-minute bars of lookback, not 14 one-minute bars.


The "safe" default and the honest tradeoff

On Bar Close ON is the safer default. It removes the possibility of repainting, which removes the possibility of making decisions on data that will change retroactively. That safety comes at the cost of lag.

On Bar Close OFF gives you fresher data at the cost of stability. It is not unsafe in absolute terms — it is a known, documented tradeoff. What makes it risky is not the feature itself but using it without understanding what "provisional" means. If you treat the live display as settled fact, you will eventually be surprised. If you treat it as the best available estimate that will be finalized at bar close, you can use it deliberately.

There is no correct answer that applies to everyone. There is a tradeoff, and the indicator surfaces it as a toggle rather than making the choice for you.

The cost of the OFF mode is worth stating in experiential terms, because the data sheet version — "values may change retroactively" — does not capture what actually happens. What happens is this: you watch the display over a session. You develop a feel for how the slots and the blend move. You start to build intuitions about what certain readings mean. After a few days, those intuitions feel solid. But the readings you built them on included provisional values that shifted after the fact. The chart you study in the evening does not match the chart you traded during the day. The discrepancies are small enough to miss individually but large enough to distort your sense of how the tool behaves. Over weeks, the gap between your experience and the chart's history widens into a quiet source of doubt. You trust the tool less, but you cannot point to the moment it lost you — because the moment was not a single event. It was a slow accumulation of readings that did not survive their own bar close.

If that cost is acceptable because you specifically need intrabar awareness and you will treat every reading as provisional, the OFF mode works. If the cost sounds like something that would erode your relationship with the tool over time, leave the default on. The indicator could have hidden this choice and locked you into one mode. Instead, it made the tradeoff visible and gave you the decision. Whichever mode you choose, know what you are choosing and what it costs.


Alerts and On Bar Close

Regardless of the On Bar Close setting, all alerts fire only on confirmed (closed) bars. Even if On Bar Close is off and the slot data is updating intrabar, the alert waits for the chart-timeframe bar to close before evaluating. This means alerts always reflect the state at bar close, even if the display showed something different moments before.

This is an intentional safety layer. The display may be provisional, but the alerts are not. If you are using alerts as your primary notification system, they will not fire on mid-bar data regardless of your On Bar Close setting.