MTF and Repainting
This page is about timing. The CTX trim's whole reason to exist is that it makes the timing decisions explicit instead of hiding them. Read this page once carefully; the rest of the pack assumes you understand the on-...
Written By Axiom Admin
Last updated 22 days ago
MTF and Repainting
This page is about timing. The CTX trim's whole reason to exist is that it makes the timing decisions explicit instead of hiding them. Read this page once carefully; the rest of the pack assumes you understand the on-bar-close switch and the live-versus-confirmed tradeoff.
A short, honest claim before the longer explanation: there is no setting in this indicator that makes a higher-timeframe value stop moving while its bar is still forming. There is a setting that hides that movement by reporting the previous, already-closed bar instead. Both of those are real choices, and which one you want depends on what you are using the slot for. The script gives you the choice per slot.
What "repainting" actually means here
The word "repainting" is used loosely in the trading community, and it is worth being precise. In this script it has a narrow, specific meaning.
When a slot reads RSI on a higher timeframe than your chart, the slot has to ask TradingView for the higher-timeframe value at every chart bar. There are two honest answers to that question:
The most recent confirmed value. That is, the RSI of the last higher-timeframe bar that has fully closed. This value will not change again β the bar it represents is in the past.
The current live value. That is, the RSI as it stands inside the higher-timeframe bar that is currently forming. This value will change as the higher-timeframe bar continues to develop, and it will keep changing until that bar closes.
Both answers are honest. Neither is "wrong." But they have very different operational consequences:
Acting on the live value means acting on a number that is allowed to move under you. If a higher-timeframe bar's RSI is 55 right now and the bar still has thirty minutes to go, that 55 may be 48 or 62 by the time the bar closes. A slot that returned 55 and a chart that you took a screenshot of will not match each other by the next chart load.
Acting on the most recent confirmed value means acting on a number that has already settled β but that number describes a bar that ended several minutes (or hours) ago. You are operating on lagged information.
Neither one is a bug. Both are tradeoffs. The CTX trim makes you choose, per slot, which tradeoff you want.
The on-bar-close switch
Each slot has a power-user input called On Bar Close?. Default: on.
On. The slot returns the most recent confirmed higher-timeframe bar's RSI and signal. The visible slot line and its color state do not move within the higher-timeframe bar that is currently forming. They update only when that bar closes. The tradeoff is latency.
Off. The slot returns the live higher-timeframe bar's RSI and signal. The visible slot line and its color state can move on every chart bar inside the higher-timeframe bar's formation. The tradeoff is that the line you are watching is allowed to settle to a different value by the time the higher-timeframe bar closes.
The switch is per slot. You can have slot 01 on confirmed and slot 02 on live in the same configuration. The switch is shared between the slot's RSI line and the slot's calculated signal value β they cannot disagree on this question. That sharing is intentional: a slot whose RSI is confirmed but whose signal is live (or vice versa) would be a slot whose color state was meaningless, and the script does not let you build that.
There is an underlying technical detail worth surfacing for the curious reader: each slot's higher-timeframe request uses lookahead, and the on-bar-close switch is what controls whether the lookahead returns a live value or a confirmed previous one. With the switch on, the value you see is the previous bar's value; the lookahead is fenced by the switch. With the switch off, you see the live value. Either way, the slot is honest about which it is doing β the choice is yours, and the consequences are visible.
A small timing walkthrough
To make this concrete, picture a 1-minute chart with a slot configured at the 60-minute timeframe. Watch the slot through one hour of trading.
At minute 0 (the moment a new 60-minute bar opens):
With
On Bar Close?on, the slot reports the RSI of the previous 60-minute bar β the one that just closed. The slot's value is stable for the next sixty minutes.With
On Bar Close?off, the slot reports the live 60-minute bar's RSI as of this single price tick. There is one bar's worth of data in the live bar so far; the value is mostly noise from the open.
At minute 30 (halfway through the 60-minute bar):
With the switch on, the slot still reports the previous bar's value. Unchanged.
With the switch off, the slot reports the live 60-minute bar's RSI as of the most recent chart bar's close. The live bar now contains thirty minutes of data; the RSI is more meaningful but is also still moving.
At minute 59 (one chart bar before the 60-minute bar closes):
With the switch on, still the previous bar's value. About to update.
With the switch off, the slot reports the live 60-minute bar's RSI based on fifty-nine minutes of data β close to, but not quite, what the bar will report when it closes.
At minute 60 (the 60-minute bar closes):
With the switch on, the slot now updates to the value of the bar that just closed. From this point forward, that value is stable for the next sixty minutes.
With the switch off, the slot's value snaps to the same number β the closed-bar value β and from there it begins reporting the new live bar.
Notice something important: at the moment the higher-timeframe bar closes, both switch settings produce the same value for that closed bar. The difference between the two settings is entirely about what they report during the bar's formation. After a bar closes, history is consistent across the two settings; before it closes, it is not.
Verifying the switch on your own chart
The fastest way to internalize the difference is to make the switch behave in front of you. The verification is short.
Open a 1m chart on a liquid symbol while the market is active.
Add the indicator. Disable every slot except slot 01. Set slot 01's timeframe to
60.Set slot 01's
On Bar Close?to on. Note the value of the slot for several chart bars. It should not change until the next 60-minute bar closes.Toggle
On Bar Close?to off. The slot's value will likely shift, because you are now reading the live higher-timeframe bar instead of the previous one. Watch it for several chart bars; it should update on every chart bar (or on most).Wait for the next 60-minute close. Both settings should report the same value at that moment.
Optional: take a screenshot at minute 30 with the switch off. Reload the chart at the next 60-minute close. The slot's historical value at the original moment will have updated to the closed-bar value, not the live one you saw at minute 30. That's the historical settling that "repaint" describes.
When you have done this once, the on-bar-close behavior stops being abstract.
The cross-asset wrinkle
Slots can read their RSI on a different ticker via the Optional Ticker input. This adds a second timing wrinkle on top of the higher-timeframe one.
A cross-asset slot follows the chosen symbol's session calendar, not the chart symbol's. If you are charting a US equity during regular hours and you load a futures contract on a slot, the futures slot keeps updating outside US equity hours and pauses when the futures market is closed. If you load a spot crypto pair on a slot while charting a 9:30β16:00 equity, the crypto slot updates around the clock during the chart's trading day and during overnight session bars (depending on what overnight bars your chart includes).
The on-bar-close switch still applies to the foreign slot, on the foreign timeframe. So:
A foreign slot with
On Bar Close?on returns the previous confirmed bar of the foreign symbol on the foreign timeframe. Stable until the foreign bar closes β at the foreign timeframe's pace.A foreign slot with the switch off returns the live foreign bar. Updates as the foreign symbol's market produces ticks.
What this looks like in practice:
During hours when the foreign symbol is closed and the chart symbol is open, the foreign slot's value is constant. It is not "frozen" or "stuck" β it is honestly reporting that the foreign symbol has not produced a new bar to read.
During hours when the chart symbol is closed but the foreign symbol is open, the chart's bars are not advancing, but the foreign slot's value will already incorporate any closed bars produced by the foreign symbol. The next chart bar to form (when the chart symbol reopens) will read whatever foreign value is current at that moment.
If you are using a cross-asset slot, expect this. Do not interpret a flat foreign slot during a session mismatch as a defect.
The cross-session wrinkle
Even when both symbols are the same, sessions can produce surprises. Holidays, half-days, futures session opens, electronic-versus-RTH calendars β anything that changes when bars are produced will affect when slots update. The script does not impose its own session filter; it inherits from the symbols and timeframes you chose.
Practical guidance:
If you trade across session boundaries (overnight US equity futures, for example), expect that slots on different timeframes will update in different rhythms across the boundary.
If you trade an instrument with an irregular calendar (FX over weekends, crypto, illiquid futures contracts), expect that some chart bars will produce no slot updates and some sessions will produce many.
None of this changes the math. It only changes the rhythm of updates the pane shows you.
Common timing-related misreads to expect
A short list of confusions the timing layer creates if it is not understood. All of them are preventable by reading the on-bar-close switch and the cross-asset wrinkle deliberately rather than after the fact.
"My higher-timeframe slot is lagging." With
On Bar Close?on, that slot is supposed to lag β by the duration of one higher-timeframe bar. If you want responsiveness, turn it off and accept the live-bar movement. The lag is not a malfunction; it is the whole reason the switch exists."My higher-timeframe slot is unstable." With
On Bar Close?off, that slot will move during the higher-timeframe bar's formation. That is the live value, behaving as live values behave."The historical value of my slot changed when I reloaded the chart." With
On Bar Close?off, the slot's historical bar at any in-progress moment will settle to the closed value once the higher-timeframe bar closes. With the switch on, this does not happen β the value reported was already a previous-bar value. If you take screenshots of intrabar states for records, this is the pattern that makes them unreliable later; either shoot with the switch on or annotate the screenshot with the caveat."My foreign slot is dead." Almost certainly a closed market on the foreign symbol. Wait until the foreign symbol's market opens, or change the slot's symbol to one whose session aligns with what you are looking for.
"All my slots flipped at the same time." Possible, but worth checking against the higher-timeframe close moments. Sometimes a 5m, 15m, and 60m slot all change reading right at a 60m close because the longer slot's update is rolling into the picture at that moment. The coincidence is often the 60m update arriving at the same chart bar as the 5m and 15m are flipping independently.
"The confirmed slot and the live slot on the same timeframe disagreed, then agreed, then disagreed again." Expected. The confirmed slot is the value of the prior closed bar; the live slot is the current forming bar. They cannot match until the current bar closes and becomes the new confirmed value. This is the normal rhythm when you run both variants of a slot on the same timeframe as a study.
Posture for serious use
A two-line summary of the operating principle this trim is built on:
Use
On Bar Close?on for slots you want to act on, and accept the latency. A confirmed value is one you can defend. If you could not explain to a colleague, a week later, why you acted on a given read, the read was probably built on a live value you saw in passing.Use
On Bar Close?off for slots you want to study during their formation, and treat the line as informational only. A live higher-timeframe value is a story being told in real time, not a fact. It can help you see structure forming; it cannot tell you that the structure is there.
A concrete pattern worth naming: a reader who wants to watch how a higher-timeframe slot is developing during its current bar can enable two slots on the same timeframe β one with On Bar Close? on, one with the switch off. The confirmed slot gives them a value they can defend if they act; the live slot gives them the developing picture to study. The two slots agree at every higher-timeframe bar close. In between closes, the distance between them is literally the shape of the repaint risk on that timeframe, drawn in front of you.
The trim does not impose this posture. It only gives you the switch. The discipline is yours.
Where to go next
For where the on-bar-close switch lives in the dialog, go to Settings.
For how state alerts interact with the confirmed-bar gating, go to Alerts.
For the larger trust questions β over-trust traps, what to verify, where the composite quietly drifts β go to Limitations and Trust Boundaries.