Using technical indicators is very popular among Forex traders. Lots of them use custom indicators with platforms like MetaTrader, cTrader, NinjaTrader, and TradingView. Sooner or later, a new trader either encounters a mention of indicator repainting or stumbles upon such an indicator itself. So, what is a repainting indicator? If you wonder what a repainting indicator is, then this tutorial is for you.
The concept of repainting and non-repainting indicator often confuses traders, especially new ones. However, there is nothing difficult in these concepts and it is also very important for traders to understand what repainting indicator is and how to recognize one because there are many scams involving the sale of repainting Forex indicators online.
What are repainting indicators?
Repainting means that the indicator is updating its display, changing what has already been on the chart. There are two major types of repainting:
Repainting the latest candle
Nearly all technical indicators constantly update the current candle value with each new tick. It is a totally normal behavior. The Close price of the current candle changes for as long as the candle is forming, so if the indicator is based on Close prices (which is often a default applied price type), the indicator's value at the current bar will change too. This isn't bad and many traders wouldn't even call this repainting. To mitigate the results of such repainting, traders should wait for the candle to close and a new one to open before taking any consideration of the indicator's value. However, if you set the indicator price type to Open, this ceases to be a problem at all. For example, see the latest candle repainting with these two classic RSI indicators — the red one is applied to Open, so its value never changes after it has been calculated for the given candle; the blue one is applied to Close and is updating with each new tick:
Repainting past candles
Some indicators are changing their signals on past candles. It means that the indicator's code is looking at the future candles to paint the display for the past bars. Of course, a trader cannot rely on such an indicator in live trading as it won't be seeing future candles when attached to a chart. This is a bad kind of repainting. For example, you can see how a famous repainting indicator Semafor keeps repainting the signals on old candles. If you would have acted on any of them, you would get yourself in trouble:
If you look at the same indicator's output in retrospect, it looks perfectly precise and impeccably timed:
Do all indicators repaint?
Of course, not all indicators are repainting. In fact, the majority of the technical indicators people use in FX trading are non-repainting. A normal (non-repainting) indicator doesn't change its signal value for the candle after that candle has closed. Non-repainting indicators never look into the future to give a signal for the current candle — they are calculated purely using the current or past candles. Such indicator will never change its value on one of the past candles should some new data arrive.
Why do indicators repaint?
Repainting of the past candles when added intentionally by the indicator developer is usually aimed at fooling potential users to make the signals appear more accurate or timely. What appears as perfect signals on a historical chart will actually turn out to be nowhere near as good in live trading. The historical chart was showing the indicator with all its signals already repainted using the chart data that hadn't been available at the time of those signals.
In short, a repainting indicator can be made to look much more appealing than a non-repainting indicator — its historical entry and exist signals very precise and perfectly timed.
Sometimes, an indicator can be made repainting intentionally but without any malicious intent. This can be useful to make further chart analysis easier or to highlight some peculiarities of the price action. In any case, the developer should clearly disclose the repainting nature of the indicator. Otherwise, it is generally considered cheating or even scamming by the community of Forex traders.
Occasionally, an indicator can be made repainting completely unintentionally. It is possible to code an indicator in such a way that it "looks" at the next bar (to the right) instead of previous bars to calculate its signal value. This error can be committed by a beginner developer without giving it a second thought. That is why it is important for indicator coders to test and backtest their work before releasing it to the public to avoid being accused in repainting scam.
Lastly, indicators that repaint the current bar based on Close/High/Low price (like the blue RSI in the example above) are coded that way intentionally, and the last candle repainting is a normal behavior for them. If you use such indicator in trading, you should take a cue only from the finished candles.
Repainting in multi-timeframe (MTF) indicators
An often-overlooked kind of repainting issue is the one that occurs in multi-timeframe (MTF) indicators. An MTF indicator is an indicator that uses data from other timeframes (normally, higher ones). For example, a simple multi-timeframe moving average indicator could be displaying an SMA value from a daily timeframe on your H1 chart.
Some MTF indicators can look very appealing thanks in large to their repainting effect. When an MTF indicator is attached to a chart of a lower timeframe, its historical values are displayed so as if the Open/High/Low/Close values of the higher timeframe candle are known at the first candle of the lower timeframe.
For example, on the historical chart below is the MTF MA of D1 attached to H1. As you can see, the higher timeframe MA value becomes visible on the first candle of the day (marked with the red arrow). However, in live trading, it wouldn't appear until the first candle of the next day (marked with the green arrow):
When trading with multi-timeframe indicators, you must always remember to keep an eye for such a repainting and never judge the efficiency of such indicators by their appearance on historical charts.
How to know if the indicator is repainting?
The easiest way to check and verify in MT4 or MT5 platforms is the Strategy Tester. You can launch a visual backtest of any indicator and see if its signals change post factum. Here is how to do it:
- Open the Strategy Tester by pressing Ctrl+R on your keyboard or via the menu: View->Strategy Tester.
- Use the Settings tab to set up a backtest of the indicator you wish to check for repainting. Switch from Expert Advisor to Indicator. Visual mode will turn on automatically. Select the indicator name via the drop-down list. Set timeframe to M1 - unless the indicator doesn't work on that timeframe; in this case, set the smallest possible timeframe. Switch Model to Every tick. Change other settings to your liking or if the indicator requires some specific configuration.
- Run the test, adjusting the speed to be able to notice if signals change on the past candles when the new ones arrive.
You can also watch the entire process in detail in this video:
As you can see, it isn't hard to tell if the indicator is repainting or not.
One potential problem with some particularly malicious indicator sellers could be that they detect whether indicator is being tested in Strategy Tester and skip repainting if so; this would conceal the repainting nature of that indicator, but it would also reveal how inferior its signals are (as the repainting is mostly done to make signals look more accurate than they are).
How to tell if an indicator is repainting if I cannot backtest it?
If the developer doesn't want to provide a demo version for backtesting, ask directly whether the indicator is repainting or non-repainting. Developer might acknowledge its repainting nature because, perhaps, the indicator isn't supposed to be used for taking direct trading signals. If the developer insists that the indicator is non-repainting but all the provided historical chart screenshots show perfect entries and exists that are too good to be true, the chances are the indicator is a repainting one.
Is an indicator that repaints useless?
Not all repainting indicators are bad. As you saw above, indicators that repaint the latest candle aren't bad at all and provide great information to technical analysts regardless of this trait. Indicators that repaint their values on the already completed candles can also be quite useful. To not use them at all because they repaint isn't always a smart choice. Of course, you must know how they function and acknowledge the fact that they repaint.
Examples of good repainting indicators
ZigZag
One of the most popular repainting indicators every trader encounters after installing a MetaTrader platform is ZigZag. It is an awesome indicator but it repaints. To use it properly, traders have to be aware that it repaints and utilize its lines and nodes solely for building support and resistance zones or trend lines.
Fractals
Fractals (or Bill Williams' Fractals) is another fascinating repainting indicator that is present in MT4 and MT5 platforms by default. Fractals are drawn using simple rules: fractal up arrow requires a high surrounded by two lower highs from each side; fractal down arrow requires a low surrounded by two higher lows from each side. As you can see, it needs five candles in total to display an arrow, and two of the candles should be in the future relative to the current one. This results in the repainting behavior. A trader should wait for two next candles to finish forming before considering the output of the Fractals indicator.
Indicators such as ZigZag and Fractals are not meant to deceive traders. They are effective in identification of support and resistance levels.
Semafor
Semafor indicator had already been mentioned above when we were first talking about indicators repainting the signals of the previous candles. Still, Semafor indicator is a worthy custom indicator available for many trading platforms. Despite the fact that it looks too good to be true, lots of people rely on it for analysis of the past price action and for marking down the important price levels on the chart. Numerous threads on popular FX forums confirm that it has no lack of fans to this day. The below chart shows an example markup of short-term and long-term support and resistance levels using the Semafor indicator:
Center of Gravity
Center of Gravity is displayed above in the tutorial on detecting repainting with Strategy Tester. It is a variant of linear regression channels and is extremely useful in two tasks - detecting trend direction and measuring the volatility of the past N candles. Of course, it is crucial to always keep in mind the repainting nature of the indicator and not to use it for direct generation of entry and exit signals for your trades. The chart example below shows a clear trend direction (up), a period of low relative volatility (between the two blue lines), a period of excess volatility (between the second blue line and the green line), and the current period of "normal" volatility.
How to fix indicator repainting?
If you are wondering if there is any way to edit an indicator so it doesn't repaint, then you have some options available.
Fixing a repainting indicator entails reprogramming it via its MQL source code. There is no some single method that is applicable to all repainting indicators for making them non-repainting.
Indicators that rely on the Close/High/Low of the current candles can be "fixed" by making them draw signals only after the current candle closes.
Repainting indicators that take advantage of looking into the future candles can be fixed by removing the code that does so. Unfortunately, the indicator might become completely unusable after that as it draws to many false signals, which previously had been hidden by the repainting process.
In both cases, you should either know some coding to try fixing the repainting or hire a professional MQL developer to fix it. If you don't have access to the source code of the indicator (.mq4 or .mq5 file) and only have compiled indicator (.ex4 or .ex5 file), it will be impossible to fix the repainting.
Other platforms
MetaTrader is arguably the most popular trading platform in online retail Forex trading. However, in other platforms, repainting indicators can also pose a problem when an unsuspecting buyer can be scammed by fraud sellers. Fortunately, as you have seen above, not all repainting indicators are useless - the trick is to know whether the indicator repaints and to use it accordingly.
cTrader
cTrader isn't free from repainting indicators. cAlgo indicators can suffer from the same types of repainting as MQL indicators. Indicators based on Close price repaint the latest candle's value. Malicious, poorly coded, or special purpose indicators can repaint the values on past candles. The problem is that it isn't possible to run indicator backtests in cTrader, so, unlike in MetaTrader, there is no fast and easy way to check if an indicator repaints. The best way is to observe how the indicator functions on some very short timeframe or, if you understand C# code, analyze the source code of the indicator (when it is available).
Here is a time-lapse of ZigZag indicator repainting in cTrader on a tick chart:
NinjaTrader
NinjaTrader is not immune to repainting indicators either. If you use this trading platform, you have to be aware of the repainting nature of the indicators you use. To check whether an indicator is a repainting or non-repainting one, you can use Market Replay facility of NinjaTrader. It effectively allows you to backtest any indicator on a chart of your choice.
Here is a Market Replay demonstration of the Fractals indicator repainting in NinjaTrader - note that signals appear only two candles in the future:
TradingView
TradingView is a very popular charting platform among all kinds of financial traders (including crypto and Forex). The main repainting indicator problem - when indicator values on old candles are updated with the data from future candles apply to TradingView the same as it does to other platforms. You can test to check if the indicator is repainting either by running it on a 1-second chart as done with Fractals in the animation below, or you can launch the Replay feature to run a fast-forward replay of any amount of bars from any timeframe and see how the indicator behaves.
The other important type of repainting problem pertinent to TradingView becomes relevant when using data from upper timeframe candles. It is possible for a strategy script to see the Open, High, Low, and Close data of the upper timeframe candle during processing of its "inner" candles of the lower timeframe. This causes backtests to "predict" the minimum and maximum prices for the future period (based on the upper timeframe), which can be enormously misleading compared to the actual live tests of the strategy script.
This is mitigated by fixing the strategy script's source code so it counts the candles on the lower timeframe and accesses the upper timeframe's candle data only when enough candles on the lower timeframe are closed (e.g., sixty 1-minute candles for an H1 upper timeframe or 24 one-hour candles for a D1 upper timeframe, and so on).
In study scripts (indicators), this is fixed using the lookahead
parameter of security
function by setting it either to barmerge.lookahead_on
or to barmerge.lookahead_off
to prevent "seeing" the unfinished upper timeframe candle's data.
Unfortunately, this cannot be helped if you are dealing with a closed-source script. It could be a repainting one and you wouldn't be able to verify or fix that via the source code.
Conclusion
When taking trading signals for entries and exits from an indicator, make sure it is a non-repainting one. Trading using signals from repainting indicators will cause only loss and frustration. Always check if the indicator is repainting or non-repainting via Strategy Tester before buying one. Demand full disclosure from its developer. Don't get yourself lured by nice looking repainted charts with seemingly perfect historical signals that catch every low and high.
A good repainting indicator always makes it clear that it is indeed repainting. A bad repainting indicator disguises as a non-repainting one, tricking the users and bringing losses to their accounts.