How to determine if your indicator is a repainter - 2 easy methods

 

Hi all,

Lots of traders wonder if an indicator they find is a "repainter".

To determine this is actually very easy. But first, let's define what 'repainting' means, as most people seem confused by the correct definition.

Definition

A true 'repainter' is either a badly coded indicator or an indicator which uses non-causal filters.

In signal processing, a causal filter is a linear and time-invariant causal system. The word causal indicates that the filter output depends only on past and present inputs. A filter whose output also depends on future inputs is non-causal.

Non-causal filters use future data to 'correct' or adjust past calculated data. They calculate both backwards and forward using newly received data.

In practice, this means that while the indicator might give a certain signal or value on the current bar, several bars down the road you might notice things are completely different and the indicator seems to have 'changed its mind'. These types of indicators look fantastic when put on a chart, as it "knows" the future bars already. And thus draws a perfect picture.

This does not immediately mean such indicators are rubbish. It merely means the indicator should not be used for generating trade signals. An example is the excellent Goertzel Browser indicator, developed by mladen on this forum. This indicator shows 'cycles' and uses new (not yet known) data to 'correct' past (already plotted) data, seeking to curve-fit several cycles with different parameters optimally to current market data.

Other popular examples of non-causal indicators (which will 'repaint'):

  • FFT (Fast Fourrier Transform) indicators which are not end-pointed
  • indicators using HP filter (Hodrick Prescott) which are not end-pointed
  • indicators which use SSA and are not "end-pointed"
  • TMA (Triangular Moving Averages)
  • polynomal regression indicators
  • and logically, all indicators which attempt to 'predict' future price will repaint due to their nature.

True rubbish

One category or 'family' of indicators you should avoid and immediately trash are the so-called "SolarWind" indicators and all variants. For more info, see this thread: https://www.mql5.com/en/forum/179650

MTF Indicators

A multi-timeframe is also often called a "repainter", which is really not correct. Imagine you have an mtf indicator loaded on your M15 chart, and set for H1 timeframe. The moment this indie gives a signal, it still has to complete 4 M15 bars to ensure the signal sticks and is valid. The H1 bar might change due to sudden price changes and might change the validity of the signal. So it might disappear or change.

Just beware of this when trading with MTF indicators.

How to determine if your indicator is a repainter - 2 easy methods

1. The easiest way is to load the indicator on a new M1 or M5 chart, and load the !SnapShotI indicator. The SnapShot indicator will take a screenshot of the chart every new bar and store the image in the /files/ directory. Just let it run for a few hours and then look at the screenshots. You can then easily detect if the indicator behaves as you would expect.

I've attached the SnapShot indicator to this post below.

2. Another very easy way is to load the indicator on the MT4 History Tester and run a "visual backtest". I've tried to explain this in the screenshots below. It's super simple and very effective. You only need a relatively short backtest period and pay a bit of attention to the indicator's behaviour while watching it. Ignore the signals from the EA you loaded and use the Slider to speed up or slow down the visual backtest.

Cheers, Snow

Files:
backtest_1.png  101 kb
backtest_2.png  73 kb
backtest_3.png  98 kb
snapshoti.mq4  3 kb
 

I do it slightly different...I load indicator on 1m chart...place horizontal and vertical lines on current point in price...usually those lines not necessary...because with new ticks with maximum magnification one can see how big of a portion of an indicator moves with price...takes around 1-3 minutes...

 

Here is an EA that I use for visual tests of indicators. Copy it yoo experts folder. It actually does nothing but allows easy indicators tests, so it will not slow down the indicators test and work. Same rule as Snowski told : chose it in the experts advisor list, and set the visual mode on. After that drop any indicator on the chart to test it

Files:
 

Nice Work Snow ~~~~

 
Snowski:
Other popular examples of non-causal indicators (which will 'repaint'):
  • indicators using HP filter (Hodrick Prescott) which are not end-pointed

Is there any Hodrick Prescott Filter indicator which are end-pointed?

Thanks in advance...

 
bgrtz:
Is there any Hodrick Prescott Filter indicator which are end-pointed? Thanks in advance...

Know of one here https://www.mql5.com/en/forum/179807/page25

 

Thank you, sir...

 

Wow really informative post. I don't really know about indicators and repaints and this thread helped me clear things up. Thanks.

 

Thanks a lot for this nice post with easy description.

 

Guys.

In a some cases only a look at the code can tell if it is repainting or recalculating

At a risk of parroting : "repainting" is a coding error or a code made for a deliberate misleading. "recalculating" is a viable mathematical model that can not be changed

 

I test repainting a bit differently : place it on chart, let it run, then go to parameters, simply press OK and if it changed after that compared to what I saw before pressing OK, it is a repainter

Reason: