MTF and Repainting
Multi-timeframe tools have two honest failure modes, and this indicator leans into both. A higher-timeframe slot either reads the live, forming HTF bar — which looks sharper than it really is, because the bar can chan...
Written By Axiom Admin
Last updated 22 days ago
MTF and Repainting
Multi-timeframe tools have two honest failure modes, and this indicator leans into both. A higher-timeframe slot either reads the live, forming HTF bar — which looks sharper than it really is, because the bar can change its mind before it closes — or it reads the previous closed HTF bar, which is stable but arrives late. The tool does not pretend those two modes are the same. It gives you a switch, labels it plainly, and makes you pick.
This page is about that switch, the one rule the indicator will refuse to break, and the verification move you can run in under a minute to see exactly what each mode does on your own chart.
The switch in plain English
Every slot has its own On Bar Close? control.
ON (default on every slot). The slot reports the previous closed higher-timeframe bar's value. On a 1m chart with slot 03 at 60m, slot 03 holds its value from the last completed 60-minute bar and steps forward only when a new 60m bar closes. Inside that hour, the slot does not move.
OFF. The slot reports the live, currently-forming higher-timeframe bar's value. On a 1m chart with slot 03 at 60m, slot 03 updates as every new 1m close feeds into the still-forming 60m bar. The line will revise itself — up, down, up again — until that HTF bar finally closes.
That second behavior is repaint. It is not a bug and it is not hidden. It is the honest consequence of asking a chart that updates every minute to display a reading built from a bar that has not closed yet.
ON is the default because it is the posture a reader can defend. OFF exists because sometimes a reader genuinely wants the live HTF read and is willing to own what that means. Turning it OFF without understanding the tradeoff is how people end up trusting lines that moved under them.
On Bar Close? is per slot. Ten slots, ten independent copies of this control. You can run slot 01 ON, slot 03 OFF, and slot 07 ON in the same configuration. The blend reflects whatever each contributing slot was reporting, which means the blend can repaint too — but only in proportion to the OFF slots that are steering it. A blend with one OFF slot carrying 25% of the weight will shiver about a quarter as much as a blend where that same slot is carrying 100%. The arithmetic is the blend's weighted-average honesty showing through: every OFF slot contributes its intra-bar drift into the blend in proportion to its weight, and every ON slot contributes its step-and-hold stability in proportion to its weight. If you find yourself surprised by blend motion you did not expect, the first thing to check is which of your weighted slots are currently set to OFF.
How to decide between ON and OFF
The switch is a real decision, not a best-practice lecture. Use this frame.
Default to ON. It is the posture you can defend to yourself and to anyone looking over your shoulder. The slot reports values you can screenshot and re-read next week and know are the same values you acted on. Every published chart, every backtest comparison, every post-mortem of a trade you actually took should use ON values, because those are the values the trade saw at the time it was decided.
Consider OFF only when the live HTF read is the question. A handful of legitimate cases exist. You are scalping off a 15-minute slot on a 1m chart and you genuinely want to see the 15-minute MACD update intra-bar, knowing the last value might revise before the bar closes. You are running a screener-style monitor and you want a slot that reflects right-now rather than "as of the last close fifty-eight minutes ago." You are studying how often a slot's value survives the bar close, which is itself a useful calibration exercise. In each of those cases you are not trusting the OFF read; you are using it for a purpose that accepts revision.
What disqualifies OFF as a choice. "I want earlier signals." OFF does not give you earlier signals; it gives you earlier guesses that may or may not survive the bar. Treating those guesses as signals is the classic repaint trap, and this indicator will not protect you from doing that to yourself. If the thing you want is a shorter-timeframe read, shorten the slot's timeframe. Do not paper over a timeframe decision by flipping a repaint switch.
Mixing ON and OFF across slots. Fine to do deliberately. For example: slot 01 (5m) OFF for an intra-bar read on the fastest cadence, slot 02 (15m) ON and slot 03 (60m) ON for stable regime context. Document your choice in whatever notes system you use. The pane will not remind you which slots are OFF when you return to it tomorrow.
The one rule the tool will enforce for you
Every slot's timeframe must be greater than or equal to the chart timeframe. If you configure slot 01 at 1m while your chart is on 5m, the script stops and tells you:
MACD 01 timeframe cannot be lower than the chart timeframe.
The message names the offending slot, and the runtime error halts the indicator rather than quietly producing a line built from data the chart does not have. There is no workaround, because there is no honest way to derive a 1-minute MACD from 5-minute bars after the fact. If you see that text, check the chart timeframe in the top-left of TradingView and either raise the offending slot's timeframe to match or drop the chart down.
The companion rule lives in the same guard: Fast Length must be strictly less than Slow Length. Swap them or set them equal and you get:
MACD 01 Fast Length must be less than Slow Length.
Same posture. Name the slot, refuse to run, surface the exact text. Troubleshooting covers the same two errors from the symptom side; this page is naming them in the context where they are most often provoked — the moment you change a slot's timeframe or lengths.
A one-chart verification you can run right now
The fastest way to feel the On Bar Close? tradeoff in your body is to watch the same slot behave two ways on the same chart.
Open a 1-minute chart on a reasonably active instrument. Default settings.
On slot 03 (60m, the slowest default slot), leave
On Bar Close?ON. Watch slot 03's line for five minutes. It stays flat, then steps once at the top of the next hour. That step is the previous 60-minute bar closing and a fresh confirmed value replacing it.Open settings. Flip slot 03's
On Bar Close?to OFF. Apply.Watch slot 03's line for five minutes. It no longer sits still. It drifts with every 1-minute close as the forming 60m bar revises. If price moves aggressively mid-hour, slot 03's line wanders with it — and wanders back if price pulls back.
Flip it back ON before you forget.
You have now seen the choice in both postures on the same slot, same symbol, same timeframe, same session. One posture is steady and late. The other is reactive and revisable. Neither is "right." Which one you want depends on whether you would rather be late with a stable read or early with a read that may not survive the bar.
A second verification for the alert layer
Alerts are a separate layer of gating that new users often conflate with On Bar Close?. The alerts are gated by barstate.isconfirmed on the chart timeframe. That means every alertcondition in this script fires only when the current chart bar closes, regardless of what any slot's On Bar Close? is set to.
Said another way: the slot's repaint switch controls what the slot shows. The chart-bar gate controls when the alerts fire. Two switches, two layers.
To verify, set up a MACD 01 Is Bullish alert with "Once Per Bar Close" on a 1m chart. With defaults, slot 01 is at 5m. The alert still fires on every 1m close — because the chart bar is the alert gate — and it fires based on slot 01's value as reported at that chart-bar close. If slot 01 is at OFF and still revising inside its 5m bar, the alert reads the current intra-bar value at the 1m close. If slot 01 is at ON, the alert reads the value of the previous closed 5m bar. Both cases, the alert itself only fires on closed 1m chart bars.
The alerts page walks the 24 conditions; this page just wants you to see the two gating layers as separate things.
The Optional Ticker interaction
Every slot also has an Optional Ticker input. If it is blank, the slot reads the chart instrument. If you set it (for example, "SPY"), the slot reads that symbol's source, that symbol's MA family, that symbol's lengths — and, importantly, that symbol's ATR on the slot's timeframe. The slot does not borrow the chart instrument's ATR; its volatility yardstick is the ticker it is configured for.
That has two practical consequences for MTF:
A slot with
Optional Ticker = "SPY"at 60m on a chart ofBTCUSDTon 1m does not "see" anything about BTCUSDT. It sees SPY's 60m MACD normalized in SPY's own 60m ATR. The line is plotted in your BTC chart's pane, but the evidence is entirely from SPY.If SPY is closed (weekend, holiday) and BTCUSDT is open, the cross-asset slot can freeze or step oddly because the other market is not producing new bars. That is not repaint; that is a different instrument's session honest about its hours.
So when you see a cross-asset slot's line behaving unlike its neighbors, the first question is not "what is wrong with the slot." It is "what is this slot actually reading, and is that market open right now."
One subtle case worth naming. If Optional Ticker points at a symbol that uses extended-hours data and your chart instrument does not, the two contexts will drift apart during the evening session — not because anything in the indicator changed, but because one of the instruments is still printing bars while the other is waiting for the next regular-hours open. The cross-asset slot's ATR will keep updating on whatever tape its ticker produces. That is the honest answer on both sides of the split, and the place it most often bites is a late-Friday or Sunday-evening chart where readers assume a quiet pane and find the cross-asset slot alive.
A short checklist to re-run when something on the pane feels off
If a slot looks wrong or the blend is moving in a way you did not expect, walk these five questions in order before reaching for settings.
What timeframe is the chart on right now? And what timeframes are my enabled slots on?
Which of my weighted slots are currently
On Bar Close? = OFF?Does any weighted slot have an
Optional Tickerset, and if so, is that market open and printing bars?Is the chart on an extended-hours session, and are any of my slots on instruments that do or do not respect that?
Has master smoothing been on since the last time I checked this pane?
Four of the five surprises this page prepares you for trace to one of those answers. If none of them explain what you are seeing, troubleshooting is the next stop.
Where to go next
If you want to configure On Bar Close? per slot alongside the other inputs, see Settings. If you are about to set up alerts and want the chart-bar gating distinction made precise, go to Alerts. If you tripped one of the runtime errors named on this page, Troubleshooting has the symptom-to-fix walkthrough. And if the Optional Ticker behavior is new to you, Workflows has the cross-asset context scenario and Limitations & Trust Boundaries has the named misreads.