MTF and Repainting

The timing difference depends on where you are coming from. From Base, the big shift is that **`On Bar Close?` is set per slot, not globally.** One switch for each of the five slots. From CTX, that per-slot posture sh...

Written By Axiom Admin

Last updated 22 days ago

MTF and Repainting

The timing difference depends on where you are coming from. From Base, the big shift is that On Bar Close? is set per slot, not globally. One switch for each of the five slots. From CTX, that per-slot posture should already feel familiar; STR keeps it while limiting the stack to five slots because the structure layer consumes the extra budget. That makes STR more expressive and more error-prone than Base, and this page treats it as both.

If you are coming from Base, read the entire page. The per-slot surface looks like a clean upgrade and is not. If you are configuring STR for the first time, do the 1m verification at the bottom before committing to a configuration for a live session.

The per-slot On Bar Close? decision β€” and why it is a tradeoff

Each slot carries its own On Bar Close? boolean. Default is ON for every slot. The switch controls what the slot's request.security call returns:

  • ON. The slot returns the previous slot-bar's finalized value. Safer. One bar behind its own context. The slot's line does not move inside a slot bar β€” it steps at slot-bar close.

  • OFF. The slot returns the live, in-progress slot-bar value. Faster. Can repaint until the slot bar closes. The slot's line can walk during a slot bar and land somewhere different by the time that bar finalizes.

Neither option is better. They are different answers to a tradeoff you own.

What makes the per-slot surface more error-prone than Base's global switch is a second-order effect that is easy to miss. STR lets you mix postures across slots. A reader who flips the 60m slot to OFF for "faster HTF reads" while leaving chart-TF slots at ON is producing a blend whose repaint posture is inconsistent across its members β€” some slots can walk during their own bars, others cannot. The blended fast line inherits the posture of whichever slot is currently walking, and the four structure features then read off that blend. A Keltner stretch that forms because a walking HTF slot temporarily pushed the blend far from its basis, then retreats when the slot's bar closes, is not the Keltner envelope lying. It is the honest consequence of a mixed-posture blend, read by four features that all consume the same line.

Mixed posture is not forbidden, and it is not automatically wrong. For a reader who wants a walking 60m voice weighted against stable lower-TF slots, it is the whole point. The rule is only that the mix has to be a choice the reader can describe, not a byproduct of clicking a switch on whichever slot happened to be in front of them.

Rule of thumb: If you cannot finish the sentence "I flipped this slot to OFF because [...]" in one clause, leave it ON. The default is defensible. The lag is the honest cost of not letting the slot repaint.

The slot-TF-at-or-above-chart-TF rule

Every slot's timeframe must be at or above the chart timeframe. A slot pointed at a timeframe below chart TF will raise a Pine runtime error on load:

MACD 0N timeframe cannot be lower than the chart timeframe.

The error names the slot that violated the rule. Fix: raise that slot's TF to at or above the chart TF, or set it to empty string (which means "run on chart TF").

Related runtime guardrails:

  • Fast Length must be strictly less than Slow Length on every slot. Violation raises MACD 0N Fast Length must be less than Slow Length. Same fix pattern.

These are not footnotes. They are the guardrails that prevent certain nonsensical configurations from silently producing nonsense on the pane.

Chart-timeframe collapse

If a slot's Timeframe is set to empty string, that slot runs on the chart TF. Depending on the slot's On Bar Close? flag, that means:

  • TF empty, On Bar Close? ON. The slot reads the previous chart bar. The line is one bar lagged from the current chart bar and stays off the live bar's tick-by-tick movement.

  • TF empty, On Bar Close? OFF. The slot reads the live chart bar. The line updates with ticks.

Both are legitimate. The first gives you a lagged, stable confirmed-bar read. The second gives you a truly live read that walks during the bar.

A reader who wants a chart-TF slot to be strictly live should set TF empty and On Bar Close? OFF and understand that the "repaint" in this configuration is simply the current bar updating with ticks β€” not a bug.

A reader who sets TF to the same string as the chart TF without setting it empty gets the same collapse, with the same interpretations of On Bar Close?. The MTF benefit for that slot is gone. That is not automatically wrong β€” using the chart TF as one of the five slots to see the other slots against it is a real use case β€” but know what you are doing.

Divergence confirmation timing

The divergence module uses ta.pivothigh and ta.pivotlow at a single Pivot Len used for both left and right sides. Pivot Len at 20 means a pivot is not confirmed until the right-shoulder bar has closed 20 bars after the pivot itself.

Divergence triangles arrive late by design. That lateness is the cost of strict pivots. A shorter Pivot Len gives you more triangles and more wrong ones. A longer one gives you fewer and later. There is no setting at which divergence confirmation becomes instant.

The alert evaluation is gated on barstate.isconfirmed. The alert can only fire on a confirmed bar. It cannot fire on tick and it cannot fire mid-bar.

The pane's divergence geometry is a description of two confirmed pivots at matched offsets. Nothing about that description arrives before the right-shoulder pivot is itself confirmed.

Plot On Pivot back-paint β€” honesty beat in full

Plot On Pivot deserves its own section on every page that mentions it, and this page is one of them.

What it does mechanically. The triangle's bar offset is -PivotLookback when ON, and 0 when OFF. That is a pure visual offset.

What OFF shows. The triangle sits on the right-shoulder confirmation bar. That is the bar the alert fired on. A reader scrolling through history with the setting OFF is looking at markers placed on alert bars.

What ON shows. The triangle sits on the original pivot bar β€” Pivot Len bars before the confirmation bar. That is a truthful picture of where the divergence pattern formed. It is also, necessarily, a bar on which the marker was not visible in real time. At that earlier bar, the right-shoulder pivot had not yet formed. The confirmation had not yet arrived. The alert had not yet fired.

Why this matters. A reader glancing at a historical chart with the setting ON can think "I could have seen this triangle at that bar." They could not have. The marker is a post-hoc visualization of where the geometry ended up forming, not a record of what was visible at the time.

How to use ON responsibly. ON is legitimately useful for post-hoc analysis of where patterns formed. If you use it:

  • Keep both facts in your head: the marker shows where the pattern formed; the alert fired Pivot Len bars later.

  • Do not use the ON visual as evidence that you could have acted at the marker's bar.

  • Do not wire trading decisions off the ON visual's bar position.

When to prefer OFF. If you are training your intuition on when divergence alerts would have reached you in real time. If you are timing entries off any aspect of the divergence moment. If you are a new user learning the divergence feature.

This is the single highest-stakes honesty beat in the pack. The setting is a valuable visual. It is also, if read carelessly, a lie about the past.

One-minute chart verification β€” run this once

Do this on a liquid symbol you know well. It will take fifteen minutes and it will teach you the per-slot repaint posture faster than any paragraph can.

Setup. Load the indicator with defaults on a 1m chart. Confirm three slots enabled at 5m, 15m, 60m with On Bar Close? ON across all three.

Experiment 1: HTF slot On Bar Close? behavior.

  1. Pick the 60m slot. Un-hide its line (set Hide Plot OFF in MACD 03) so you can see it move.

  2. Watch the 60m slot's line for ten minutes. The line should step exactly at 60m bar closes and stay flat between them.

  3. Flip MACD 03's On Bar Close? to OFF. Watch for another ten minutes. The 60m slot's line should now walk during the 60m bar β€” updating as ticks arrive on the chart TF β€” and land at a final value when the 60m bar closes.

  4. Compare the final value across the two modes. They should agree at the 60m bar close.

That is the lag-versus-repaint tradeoff, visible. Decide which posture you want on that slot based on what you saw.

Experiment 2: Plot On Pivot comparison.

  1. Find a recent confirmed divergence triangle on the chart. Zoom in so you can see both the triangle and several bars to either side.

  2. With Plot On Pivot OFF (the default), note the triangle's bar position. That is the right-shoulder confirmation bar.

  3. Toggle Plot On Pivot ON. The triangle should visibly back-shift by Pivot Len bars β€” 20 bars at default.

  4. Confirm the alert did not re-fire. (The alert panel in TradingView will show no new alert event.)

  5. Toggle Plot On Pivot OFF again. The triangle should return to the confirmation bar.

The alert bar does not move. The triangle does. That is the setting's entire behavior. Internalize it before you use the setting in a live configuration.

Experiment 3: Chart-TF collapse.

  1. Set MACD 04's Enable to ON and its Timeframe to empty string. Leave On Bar Close? at ON.

  2. Watch MACD 04's contribution on the pane. It should step exactly with each chart bar β€” one bar lagged from the live bar.

  3. Flip MACD 04's On Bar Close? to OFF. Watch the slot's line move with ticks during the live bar.

  4. Disable MACD 04 when you are done.

That is chart-TF collapse, in both postures. Know what it looks like so you recognize it if you ever configure it unintentionally.

Master smoothing's effect on timing

Master smoothing (in the Blend Core group) applies to the blended K, D, H triple after blending. It does not affect per-slot values, and it does not affect per-slot alerts. It does change the timing of blend-based behavior:

  • Blend MACD / blend signal crossings (the basis for the Blended MACD Is Bullish and Blended MACD Is Bearish alerts) will fire later than they would without smoothing.

  • The four structure features all read from the blended fast line after master smoothing. With smoothing ON, Keltner, BBWP, Donchian, and divergence all receive a smoothed input. That changes what they draw.

If you are using master smoothing to fix "choppy" blend-based alerts, recognize that the chop was evidence and you have hidden it, not solved it. If you are using it for a specific reason β€” e.g., the raw blend was reacting to noise you wanted averaged out β€” treat that as a deliberate tradeoff between response time and signal stability.

Summary of the repaint posture

  • ON means one-bar lag and a steadier confirmed-history slot output.

  • OFF means live read, potential repaint until slot-bar close.

  • The switch is per slot on STR. Base's single global switch is not the same surface.

  • A blend whose slots are mixed across ON and OFF carries the posture of its weaker members. The four structure features read off that blend.

  • Divergence alerts fire only on barstate.isconfirmed, at the right-shoulder confirmation bar. Plot On Pivot does not move that bar.

  • Chart-TF collapse is a real case and not automatically wrong, provided the reader configured it deliberately.

  • Master smoothing changes blend-based timing without affecting per-slot alerts.

If a misconfiguration on this page is going to hurt, it will usually be one of three things: a slot flipped to OFF on an HTF the reader did not expect to walk during its own bars, a Plot On Pivot ON visual read as real-time evidence in a post-hoc review, or a chart-TF-collapsed slot that the reader has forgotten is collapsed. Each one is quiet enough to stay in a configuration for weeks, and each one shifts the pane's behavior in a specific direction. An extra beat of thought when any of the three slips into a configuration saves real debugging time later.

Next: Alerts for the alert surface, or Limitations and Trust Boundaries for the rest of the misreads.