MTF and Repainting
STR gives you finer-grained control over repaint posture than Base does. On Base, a single global `On Bar Close?` switch decides the repaint posture for every slot at once — one setting, three slots, one answer. On ST...
Written By Axiom Admin
Last updated 22 days ago
MTF and Repainting
STR gives you finer-grained control over repaint posture than Base does. On Base, a single global On Bar Close? switch decides the repaint posture for every slot at once — one setting, three slots, one answer. On STR, each slot carries its own On Bar Close? control inside its Power User block, shared between the slot's RSI smoothing pass and its signal pass. That is the single largest structural change between Base and STR at the timing layer, and it deserves its own page because it is both an upgrade in expressive range and a new source of specific misreads that Base cannot produce.
The upgrade and the risk are the same change. Five independent switches give you the ability to match each slot's repaint posture to the slot's actual role — a slow context slot wants confirmed values, a fast live-update slot may deliberately not — and they give you the ability to end up in a mixed-posture configuration by accident, where the blend is reading confirmed and repainting members at the same time. The goal of this page is not to tell you which posture is right. It is to make sure the posture you end up with is one you chose and understood, not one you arrived at by touching three slots and leaving the other two.
This page does four things. It names the per-slot control and its tradeoff honestly. It walks the slot-timeframe rule and the runtime error it raises, including the specific situations that trip it. It teaches a verification routine you can run on a 1-minute chart so the toggle stops being abstract. And it treats mixed-posture blend behavior as its own named case so you do not discover it by accident at a moment when you cannot afford the surprise.
Per-slot On Bar Close? — first-class control, not a feature flag
Each slot exposes an On Bar Close? input, defaulting to true. The setting applies to both the RSI smoothing pass and the signal pass for that slot.
On Bar Close? = true— the slot returns the previous bar's clamped smoothed RSI and signal values from its higher-timeframe context. In practice: the slot holds its value until its own HTF bar closes, and then updates once. The posture is confirmed and slower.On Bar Close? = false— the slot returns the current bar's values from its HTF context. In practice: the slot updates intra-bar, until the HTF bar closes. The posture is live and can repaint until confirmation.
The underlying MTF fetch uses lookahead = barmerge.lookahead_on. When combined with the previous-bar return under On Bar Close? = true, this is the standard safe-MTF pattern — confirmed values from the HTF, with no forward-looking bar leakage. Under On Bar Close? = false, the safe-MTF behavior is disabled for that slot, and the slot can repaint intra-bar. Both are legitimate choices. Which one is right for a slot depends on what you are asking the slot to do.
Tradeoff in both directions. True is more honest in a backtesting sense and slower on the chart — the slot holds a value that will not change until the next HTF close. False is faster on the chart and will repaint until the HTF bar closes. Calling one universally better misses the reader's choice. A slot you are reading as a slow context ladder is probably better at true; a slot you are using to surface intra-bar HTF dynamics may deliberately want false. Both are defensible postures. The indefensible posture is not thinking about it — leaving five slots at default because the defaults are there, then discovering the mix produced an interaction you did not predict and do not know how to interpret.
The Base-to-STR upgrade is also a new failure mode. Base offered you one switch across the whole indicator. STR offers you five switches. The five-switch surface is more expressive, and it is where the most common timing-related STR misread originates — mixed-posture blends. The switches do not cost anything to leave at default; they cost something to misunderstand. Read the mixed-posture section below before you change any of them away from default.
Slot timeframe at or above chart timeframe — the runtime error
STR enforces that each enabled slot's timeframe must be at or above the chart timeframe. A slot configured with a timeframe below the chart timeframe raises a runtime error at load or on timeframe change. The exact error text the script raises is:
"<slot label> timeframe cannot be lower than the chart timeframe."
The label in the message is the specific slot (e.g. slot 03). The fix is one of two things: raise the offending slot's timeframe, or lower the chart timeframe below the slot's. There is no third option — the script will not compute against a lower-than-chart slot TF because the MTF fetch for that slot would be structurally unreliable.
This error most often appears when a reader switches chart timeframes upward and leaves a slot timeframe where it was. If slot 02 is on 15m and you change the chart from 5m to 30m, slot 02's 15m is now lower than chart — and the error fires. The fix is to move slot 02 up to 30m or above, or to move the chart back down.
Chart-TF collapse — discussed below — is a distinct case that the error does not cover.
Verifying On Bar Close? with a before-and-after drill
Do this once on a live session. The point of the drill is not to pick a posture; the point is to feel what the toggle does.
Load STR on a 1-minute chart of a liquid symbol. Leave every setting at defaults except: turn
Hide Plotoff on slot 03 (which is at timeframe 60 by default). Slot 03 should now be visible as a blue line.Watch slot 03 for a few minutes during an active session. With
On Bar Close? = true(the default), slot 03 should sit still between 60m closes and then step at the top of each hour.Change slot 03's
On Bar Close?tofalse. Watch again. Slot 03 now updates intra-bar, and its value will wobble as the 60m bar forms — eventually settling where the closed-bar value would have put it when the 60m bar closes.Compare the two visuals. The live version is faster and can repaint until the 60m close. The bar-close version is confirmed and slower.
Set slot 03 back to
true. ToggleHide Plotback on.
This drill is the cleanest way to see repaint behavior on one slot in isolation. The next drill shows what happens when the blend mixes two postures at once.
Chart-timeframe collapse — a distinct case
When a slot's timeframe matches the chart timeframe (or the slot's timeframe input is empty), the slot runs on the chart's cadence. The MTF fetch returns the chart's own values. On Bar Close? still applies — true returns the previous chart bar, false returns the current chart bar — but the slot is no longer a multi-timeframe voice; it is a chart-cadence voice.
This often happens accidentally. A reader configures slot 01 with an empty timeframe, thinking they are letting it "inherit the chart's default," and then reads the slot as an HTF context when it is actually a chart-TF read. The fix is simply to recognize it: if a slot has an empty timeframe or a timeframe equal to the chart, it is running on chart cadence. If you want MTF behavior, give it an explicit timeframe above the chart's.
Mixed-posture blend behavior — the specific STR failure mode
STR makes this case possible and this page names it plainly. Mixed-posture means: some slots sit at On Bar Close? = true, others at false, and the blend mixes their values together.
Here is what happens, step by step. The blend is a weighted mean of the slots' RSI and signal values. Some of those values are confirmed (from the true slots); others are live and can repaint (from the false slots). The blend aggregates both into one number on every bar. During an HTF bar's formation, the false slots contribute updating intra-bar values; at the HTF close, those slots' contributions resolve into the closed-bar values. The blend therefore wobbles intra-bar in proportion to the weighted contribution of the false slots. A blend with one false slot at weight 10 against four true slots at weight 22.5 each wobbles less than a blend with one false slot at weight 50 against four true slots at weight 12.5 each. The math is continuous; the practical feel of the wobble scales with the weight of the live contributors.
The direct consequence is that any structure feature over a mixed-posture blend inherits that mix. A Keltner envelope on a mixed-posture blend will look jumpier than a Keltner envelope on an all-true blend — not because Keltner math changed, but because the basis input changed. A BBWP column on a mixed-posture blend is ranking widths that include live and confirmed contributions together. A Donchian stepline on a mixed-posture blend will step to intra-bar extremes that may retreat before the bar closes, producing steplines that look transient in a way they do not on an all-confirmed blend.
None of this is wrong — it is precisely what a mixed-posture configuration describes. The cost is that structure features are no longer reading a stable line; they are reading a line whose stability is a weighted mix of confirmed and live members. If the structure features look "noisy" in a way you did not expect, check your slot postures before you reach for master smoothing. Master smoothing will dampen the noise, yes — and it will also dampen whatever information the noise was carrying about the disagreement between the posture classes.
How to decide if you actually want a mixed posture. Write down, in one sentence, what question the false slot is supposed to answer that the true slots cannot. "I want a live HTF read that updates intra-bar because I am trading on HTF momentum resolution faster than HTF closes" is a sentence. "I want the slot to be more reactive" is not — reactive at what cost, measured against what, for what decision. If you cannot write the sentence, the slot should stay at true. Mixed posture is not a performance upgrade. It is a specific configuration for a specific question.
A verification you can run. On the same 1m chart from earlier: set all enabled slots to On Bar Close? = true, watch the Keltner envelope (turn it on temporarily) across a few HTF closes. Then set slot 03 to false while leaving the others at true. Watch the Keltner envelope again. The second pass will have visibly more intra-bar movement in the upper and lower bands for reasons that originate in the blend's input posture, not in the Keltner math. Setting slot 03 back to true restores the calmer envelope. The exercise takes a few minutes; the understanding it installs is worth more than that.
Divergence and confirmed bars — a timing detail worth holding
The divergence engine is bound by its own timing, separate from On Bar Close?. Two things gate every triangle:
Pivot confirmation. The engine uses a pivot helper that needs Pivot Len bars of price action on each side of the candidate pivot. A pivot is confirmed only when Pivot Len bars to the right of it have closed. This is the strict-pivot cost — triangles lag the original pivot bar by Pivot Len bars of chart time, by construction.
Confirmed-bar gate. Divergence evaluation runs only inside
barstate.isconfirmed. Unclosed bars do not fire divergence alerts or draw triangles.
The Plot On Pivot setting does not change this timing. ON back-shifts the visual marker by Pivot Len bars to the original pivot; OFF places the marker at the confirmation bar. Either way, the alert fires on the confirmation bar, and the geometry requires Pivot Len bars of price action on the right shoulder to confirm. ON is honest about where the geometry formed; ON is misleading-looking about when a reader could have acted.
Hold both truths side by side every time Plot On Pivot is mentioned. A reader who treats the ON visual as a record of what they could have seen at that earlier bar is making decisions on evidence that did not exist at that moment.
Warm-up nulls — where else timing bites
Besides repaint and divergence timing, the pane has several warm-up periods that leave values missing until enough bars accumulate:
The RSI smoothing pass needs Smoothing Length bars.
The signal pass needs Signal Length additional bars on top of that.
The BBWP lookback window needs its full length (default 252) of prior blend widths.
The divergence pivot state needs a confirmed prior pivot in each direction before it has a comparison to make.
On a fresh chart or a sparsely-populated instrument, you will see missing BBWP columns, early slot tones that are not yet mature signal-vs-RSI reads, and no divergence triangles until a confirmed prior pivot pair exists. In the common signal warm-up path, the helper substitutes the slot's current smoothed RSI until the signal MA can return a value, so equality produces the faded/down tone and no bullish or bearish state alert. None of this is a bug; all of it is the timing cost of honest construction.
Where to go next
When you are ready to wire alerts with the timing picture in mind, Alerts is the next page — pay particular attention to the confirmed-bar gating across all sixteen alert conditions. If you are configuring slots and want to match each slot's repaint posture to its role in the blend, Settings walks the per-slot primary and Power User blocks in detail. If you are seeing the jumpy-structure-feature symptom described above and want a symptom-to-cause diagnosis path, Troubleshooting routes the mixed-posture case with the corresponding fix.