[Introduction] Definition and ways to distinguish repainting — phenomenon where the display of confirmed legs changes
Hello, I’m the captain of the lab.
Today, I’m thinking of writing a piece about indicator ideas.
EA is fully automatic, but I think many people may feel uneasy about leaving everything to automation.
For those people,I want to trade mostly at my own discretion!But if there are no hints at all, won’t you end up guessing and losing?
In such cases,it seems quite natural to rely on an indicator that tells you when to buy or sellto have good timing for trades.
Therefore, I thought it might be helpful to write from the perspective of choosing such indicator products.
◆ Summary
Repainting refers to the phenomenon where arrows or lines that an indicator once displayed are rewritten later.
In this article, I broadly use this term to include not only cases where the display after a bar’s close changes but also cases where displays before a bar’s close disappear (the scope of naming varies by person).
In backtests of EA using indicators, repainting is one of the reasons numbers can look better than in real operation.
◆ 1. What gets rewritten?
A bar is considered confirmed when the time frame closes and its high, low, and close are determined.
The latest bar is in the middle of price action, and the indicator’s display moving is normal behavior.
Moving averages also continue to move on the latest bar.
The problem is when the past displays change after a bar is confirmed.
For example, a buy arrow that appeared on a certain bar may disappear over time, and a new arrow may appear on another bar. Also, there are cases where an arrow appears before a bar closes and disappears before that bar closes.
If you enter by looking at these arrows, the traded orders remain, but the signal itself may have disappeared.
(A) The latest bar’s price moves (normal behavior), (B) a display that appeared before the bar’s close disappears before it is confirmed, (C) past displays change after confirmation.
(B) and (C) are the problematic repainting cases.
【Image:fig70_three_cases.png】
【Image:fig66_repaint_image.png】
◆ 2. Why does it happen?
Judgment like “this was the bottom” cannot be confirmed without watching subsequent price movement.
Highs and lows are determined after prices move back to a certain extent.
Therefore, indicators performing such calculations may mark past positions afterward.
A typical example is ZigZag, which redraws lines of past highs and lows after a reversal is confirmed.
Also, there are indicators like fractals that require looking several bars ahead to confirm.【Image:fig67_repaint_flow.png】
◆ 3. Impact on backtesting
When a backtest calls an indicator, the tester computes using confirmed past data.
Therefore, it uses the rewritten values, making the performance look better than in real operation.
On the other hand, in real operation, the signal’s appearance at the time of entry may be uncertain, and the arrow may disappear after entry.
The core issue is the tendency of test numbers to look better than real operation.
This gap manifests as a divergence between test results and real operation. In real operation, spread and fill slippage also add to this.【Image:fig68_tester_vs_live.png】
◆ 4. How to identify (4 methods)
Observe a real-time chart for a certain period.
Watch for arrows appearing and then disappearing or changing position.
Keep periodic screenshots so you can compare later
Run the tester in visual mode.
Slow down and watch carefully to see whether arrows appear and disappear within a bar’s path
Check whether past arrows align too perfectly with a floor or ceiling
However, don’t decide based on this alone; use with other methods
In the case of EA, verify whether it judges based on the confirmed bar’s value.
In MT4, the current bar is counted as “0” and the immediately prior confirmed bar as “1.”
Using the current bar’s value, the bar’s value can still change until it is confirmed. 1 to 3 can be checked even without reading the code.
4 involves checking if the EA’s internals can be viewed; if the source code is available, you can also verify whether it references the current or future bars.【Image:fig69_check_methods.png】
Indicators that are calculated only from the confirmed bar’s close are less likely to repaint.
If the sales page images only show arrows on past charts, you should verify whether there is real-time recording.
◆ 5. Relationship with Look-Ahead Bias
The Look-Ahead Bias discussed in Episode 11 is a general term for using future information.
Repainting can be categorized as a phenomenon caused by indicators, in which the same outcome arises from that issue.
The entry point differs, but the idea that “the future that should not be visible affects the result” is common.
When evaluating EA that uses indicators, add “does not rewrite the past” as a check item.
When backtest numbers are good, first verify that those numbers were not calculated from values after confirmation.
◆ 6. Relation to Lab Verification Standards
In the Lab’s verification standards, there is a second axis called “logical soundness.”
Whether future information has crept in is a view aligned with this axis. Anomaly v04 uses a logic based on the combination of day of week and time and does not use indicators.
Therefore, repaint is not a point of contention here.
The gap between test and real operation is in the domain of the third axis, “adaptation and robustness to real environments.”
However, whether you use indicators is not a matter of superiority or inferiority, but rather a matter of understanding their behavior if you do use them.
◆ 7. Points to note
Not all repainting indicators are inherently inappropriate.
There are methods to use only signals from confirmed bars, once you understand the mechanism.
This article does not intend to evaluate specific products or providers; it is organizing checks for verification.
Verification should be ongoing, each time you use a new product or setting.
Another approach is to ask the seller whether there is real-time recording and whether judgments are made on confirmed bars.
The specificity of the answer also becomes a material for judgment.
The entry point for verification is MT4/MT5 backtest reports; more than the numbers themselves, you should look at the conditions under which those numbers are valid. This approach forms the foundation here as well.
We at Semura Lab. make it a principle to present numbers without adornment, with conditions and limitations attached. If you’re unsure about how the indicator behaves, feel free to reach out at our “Yorozu Consultation Desk.” Yorozu Consultation Desk → https://www.gogojungle.co.jp/mypage/community/485