MQL4: How to find if an Indicator Repaints
Repainting Indicators: A Big Problem
Sometimes when we see the final result of an indicator it appears too good to be true. Simply amazing that it could predict so well. But when we use it in real-time, we realize that the indicator massively repaints. So, we should have a way of finding it out beforehand, so we don’t use the indicator’s results on our real accounts.
This post shows how to find a repainting Arrow Indicator. But the same logic can be applied to other types of indicators. I have taken the Binary Viper Indicator as an example and used a wrapper indicator to check how much it repaints.
How does the Wrapper work?
It’s very simple. Wrapper Indicator just fills the buffer values and draws the arrows as they appear on original indicator. And it does not change the arrows even if the original indicator deletes them. As you can see in this image, the yellow arrows show everytime BinaryViper redraws the arrows and the Red Arrow is the final Down arrow in BinaryViper.
As you can see, it repainted 15 times before settling on a final down arrow (red).
How to Use:
To use the wrapper on your own arrow indicator just replace this code with your own indicator name:
double arrow_up = iCustom(NULL, 0, "Binary Viper v2.00", 0,i);
double arrow_down = iCustom(NULL, 0, "Binary Viper v2.00", 1,i);
Just use it with an empty expert advisor to see the results quickly.