MTF & Repainting

This is the most important page in the manual.

Written By Axiom Admin

Last updated About 1 month ago

MTF & Repainting

This is the most important page in the manual.

If you read only one page beyond the quick start, make it this one. Everything else β€” settings, workflows, alerts β€” sits on top of the trust mechanism described here. If you do not understand how the indicator handles higher-timeframe data, you cannot evaluate whether to trust what you see on the chart.


The problem this indicator was built to solve

Most higher-timeframe overlays on TradingView have a repainting problem, and it is one of the hardest problems to notice because the chart always looks clean in hindsight.

Here is how it works:

When an indicator pulls data from a higher timeframe β€” say you are on a 1-minute chart and the indicator requests 60-minute data β€” there is a question about which 60-minute bar to use. The one that is still forming? Or the last one that finished?

If the indicator uses the still-forming bar, the values change throughout the hour as the 60-minute candle develops. At minute 1, the 60-minute high might be 100. At minute 30, it might be 105. At minute 59, it might be 103. Every time the 60-minute bar's high or low changes, the indicator's channel shifts.

Now here is the part that causes real damage: once that 60-minute bar closes, TradingView stores the final confirmed values. When you scroll back through history later, you see the final values on every 1-minute bar within that hour β€” not the mid-formation values that were actually visible at the time. The chart shows you a clean, stable picture that never existed in real time.

This is repainting. The historical display is a lie β€” not because anyone designed it to deceive, but because the indicator showed one thing while the bar was forming and a different thing after it closed, and history only records the final version.

Why this matters for trading:

If you build a strategy using an indicator that repaints, your backtest is running against data that was not available at the time. The strategy engine sees the confirmed values β€” the final versions that only existed after the bar closed. The entries and exits it identifies were based on values that no live trader could have seen. Your backtest accuracy is fictional.

This is the kind of problem that does not show up during research. The backtest looks great. The equity curve climbs. The win rate is 85%. You go through all the motions of responsible testing, and then you connect it to real money and the performance disappears β€” or worse, it does the opposite of what the test predicted. And there is nothing wrong with your logic, nothing wrong with your risk management, nothing wrong with your discipline. The data itself was lying. The indicator showed you one thing during the bar and stored a different thing afterward, and the backtest could only see the stored version.

The founders of Axiom hit this wall with a bot that showed 300% monthly returns in backtesting and lost money live. A 96% accuracy rate, and it was still a failure. The indicator was repainting. That discovery is the reason these tools exist.


How Axiom DC Lite handles this

Axiom DC Lite gives you a choice, and the confirmed-bar option is the default.

On Bar Close ON (default): confirmed-bar behavior

When On Bar Close is enabled β€” which it is by default β€” every slot uses the last completed higher-timeframe bar's Donchian values. The indicator does not look at the bar that is currently forming. It waits for confirmation.

What this means in practice:

  • On a 1-minute chart with a 5-minute slot, the channel uses the Donchian values from the previous completed 5-minute bar. The current 5-minute bar, which is still forming, is ignored.

  • The channel updates in steps. Every 5 minutes (when a new 5-minute bar closes), the values jump to reflect the new confirmed bar. Between closes, the channel is flat.

  • What you see on any historical bar is the same value that was available at the time that bar closed. The picture does not change after the fact.

  • Historical review stays aligned with what this script would have shown on confirmed bars.

  • If you reuse the same confirmed values in downstream logic, this removes this indicator's own HTF future-leak path. It does not make the rest of that logic trustworthy by itself.

The cost of this approach is lag. The channel is always one higher-timeframe bar behind the most recent action. On a 60-minute slot, that means up to 60 minutes of delay before the channel reflects the current hour's price action. That lag is the price of trust.

On Bar Close OFF: building-bar behavior

When On Bar Close is turned off, every slot uses the current forming higher-timeframe bar's values. The channel updates in real time as the HTF candle develops.

What this means in practice:

  • The channels are more responsive. You see the current hour's structural range developing in real time, not waiting until the hour closes.

  • But the values you see during formation will change before the bar closes. The high at minute 20 may not be the high at minute 59.

  • Historical bars show the final confirmed values, because that is all TradingView stores. But the live bar shows the in-progress values. There is a visual discontinuity between the two: the historical picture is stable, the live bar is shifting.

  • Backtests are unreliable. The strategy engine tests against confirmed historical values, but a live trader would have seen mid-formation values that may have been different. Any edge identified in a backtest with On Bar Close off is suspect.

The tradeoff in plain terms

On Bar Close ON

On Bar Close OFF

What you see

Last confirmed HTF bar's values

Current forming HTF bar's values

Update speed

Steps at each HTF bar close

Updates in real time within the bar

History stability

Stable β€” matches what was available live

Stable in history, shifting on live bar

Backtest reliability

Reliable

Unreliable

Lag

Up to one HTF bar period

Minimal

Repainting

No

Yes, within the current HTF bar

This is not a case where one option is right and the other is wrong. It is a case where confirmed history and speed are in tension, and the indicator lets you choose. The default favors confirmed history.


How to verify confirmed-bar behavior yourself

Everything above is a claim. Claims from tool vendors are easy to make and historically unreliable in this market. So rather than asking you to believe it, this section gives you the procedure to check it yourself.

The walkthrough takes five minutes. At the end, you will have seen both modes with your own eyes and you will know β€” not believe, know β€” whether the indicator does what it says.

Step 1: Set up the test

  1. Open a 1-minute chart on any liquid instrument.

  2. Add Axiom DC Lite with default settings. Make sure On Bar Close is ON (the default).

  3. Focus on the DC 01 slot (teal lines, 5-minute timeframe).

Step 2: Watch a 5-minute bar form

  1. Watch the chart for 5 minutes β€” one full 5-minute bar.

  2. During those 5 minutes, pay attention to the DC 01 channel. It should be flat. The teal upper, lower, and basis lines should not move at all during this period.

  3. When the 5-minute bar closes (you will see a new 1-minute bar appear at the 5-minute boundary), the DC 01 channel may step to new values. Or it may stay where it is if the new confirmed bar did not change the Donchian lookback result.

Step 3: Compare to history

  1. Scroll back a few bars. Look at the DC 01 channel values on the completed 5-minute periods.

  2. They should match what you observed during the live formation: flat within each 5-minute window, stepping at each 5-minute boundary.

  3. There should be no discontinuity between what you saw live and what you see now in history.

Step 4: Now test the other mode

  1. Go to the indicator settings and turn On Bar Close OFF.

  2. Watch the same chart for another 5 minutes.

  3. This time, the DC 01 channel should be moving β€” updating as the current 5-minute bar develops. The values shift as the high and low of the forming bar change.

  4. After the 5-minute bar closes, look at the historical bars for the period you just watched. The values in history show the final confirmed numbers. If the high at minute 3 was 100 and the final high was 102, history shows 102 for the entire period β€” even though you saw 100 during minute 3.

This is the repainting in action. The live view and the historical view disagree. That disagreement is exactly what On Bar Close ON prevents.

Step 5: Turn it back on

Turn On Bar Close back to ON before you rely on any analysis. The verification is complete β€” you have seen both modes with your own eyes.


The backtest question, answered directly

"Can I use this indicator in a strategy backtest?"

Only in a narrow sense: when On Bar Close is ON, the HTF values this indicator plots on historical bars are the same values that would have been available at those confirmed closes. If you rebuild the same confirmed HTF logic inside downstream testing, you avoid this specific future-leak problem from the indicator side. That still does not validate the rest of the strategy.

"What if I turn On Bar Close off for the backtest?"

Then your backtest results are unreliable. The strategy engine evaluates against confirmed historical values. But a live trader would have seen building-bar values during formation. An entry condition that triggered based on the mid-bar value might not have triggered at bar close, or vice versa. The backtest describes a scenario that could not have been replicated in real time.

"What about alerts β€” do they repaint?"

No. Every alert in this indicator is gated by barstate.isconfirmed, which means the alert fires only after the chart-timeframe bar has closed. This is independent of the On Bar Close setting. The alerts always use confirmed chart bars, even if the underlying channel data is using building HTF bars.

However, there is a subtlety: if On Bar Close is off, the channel values the alert evaluates may still be based on the building HTF bar's data at the time of chart-bar close. The alert fires on confirmed chart bars, but the channel values it checks are only as trustworthy as the On Bar Close setting allows.

"Is On Bar Close ON the same as no repainting at all?"

For the Donchian Channel values, yes. With On Bar Close ON, the values displayed on any historical bar were available at that bar's close. They do not change after the fact.

For the basis line with MA smoothing applied (Basis MA Length > 1), the same principle holds. The smoothed basis is computed inside the higher-timeframe context and then the confirmed result is returned. The smoothing does not introduce a separate repainting path.


What confirmed-bar higher-timeframe handling actually means

The confirmed-bar HTF pattern has a specific technical meaning in TradingView's Pine Script ecosystem. It refers to requesting higher-timeframe data in a way that keeps future information out of the historical display for this indicator's own HTF values.

The standard pattern works like this: the indicator requests the data with a one-bar offset, asking for the previous bar's values rather than the current bar's values. Combined with a specific TradingView setting that controls how the request is processed, this ensures that the value returned at any point in time was definitively finalized before that point. There is no window where the value could change β€” it was already confirmed when it was delivered.

This is not a proprietary technique. It is a well-established pattern in Pine development, documented by TradingView and used by experienced script authors. What Axiom DC Lite does is apply this pattern consistently across all three slots, with a user-accessible toggle that lets you choose between the confirmed-bar version and the faster (but repainting) version.

For a deeper explanation of the mechanism, see Under the Hood.


Mental model: think of it like a newspaper versus a news ticker

Here is an analogy that may help:

On Bar Close ON is like reading the morning newspaper. The stories are from yesterday β€” they are confirmed, edited, and final. Nothing in tomorrow's paper will change what today's paper said. You are always one edition behind the breaking news, but what you read is reliable.

On Bar Close OFF is like watching a live news ticker. You get the latest developments as they happen, but the ticker updates and corrects itself throughout the day. The headline at 10 AM might be different from the headline at 2 PM, even if they are about the same event. If you recorded the ticker at 10 AM and played it back later, it would not match what the ticker showed at 2 PM. The archive only keeps the final version.

A backtest is like an archive. It only has the final version. If your strategy was built on the 10 AM headline β€” which might have been revised by 2 PM β€” the archive says you saw the 2 PM version all along. Your strategy's track record is based on information you never had.

The newspaper is slower. The ticker is faster. The newspaper does not lie about what it said yesterday. That is the tradeoff.


Visual asset: On Bar Close comparison

{% hint style="info" %} Placeholder for On Bar Close comparison screenshot

The screenshot must show a side-by-side or stacked comparison:

Left/Top β€” On Bar Close ON:

  • A 1-minute chart showing a DC slot with clear step-change behavior

  • The channel is flat between HTF bar closes, then jumps

  • Historical bars and the live bar show consistent values

Right/Bottom β€” On Bar Close OFF:

  • The same chart and period with On Bar Close OFF

  • The channel updates within the HTF bar formation period

  • The live bar shows values that differ from nearby historical bars

  • An annotation pointing to the repainting boundary (where historical confirmed values meet live building values)

Both panels should cover the same time period on the same instrument to make the comparison direct. {% endhint %}


When the lag feels uncomfortable

There will be moments when On Bar Close ON feels frustrating. Price is moving, the current hour is clearly different from the last hour, and the 60-minute slot is still showing the previous hour's values. You can see the market doing something, and the indicator has not caught up yet. It feels like you are looking at stale data while the action happens without you.

That discomfort is real and it is worth sitting with rather than immediately fixing. The impulse to turn On Bar Close off is strongest during fast moves β€” the exact moments when the building bar's values are changing the most. And the more the building values change during the bar, the wider the gap between what you would see live and what history will record afterward. The periods when the lag is most frustrating are the periods when the repainting distortion is largest.

Before you reach for the toggle, ask yourself one question: If the channel value changed after the bar closed, would the decision I made during the bar still have been correct?

If the answer is "I don't know" or "probably not," the lag is protecting you from a decision that depends on information that has not been confirmed yet. The flat channel is not missing the move β€” it is telling you that nothing has been confirmed since the last update. That is a different statement from "nothing is happening," and learning to read it that way is part of using the tool well.