What is repainting and Non-repainting in amibroker afl

I heard a lot about repainting and Non-repainting when I search afl on Internet. Can any1 explain what exactly it means…?

most of the time you find buy or sell signal occurs in the current bar and before the candle completes the signal get erased. This happens when the signal oscillates back and forth the threshold levels which decides the occurence of buy or sell signal. we can name it as current bar repainting.​ to eliminate the current bar repainting​ we use non repainting

Re-painting occurs when the indicator relies on the closing value of the current price bar in order to update accurately. Therefore, whenever a price bar is still open the indicator has the potential to move higher or lower until the close is confirmed.

Better to take trading decision based on candle/bar close to avoid re-painting.

Non-repainting indicators, on the other hand, are usually based on the data provided through the opening of the current price bar. Once the bar has opened, the indicator will remain fixed until the next open.

Ex : Repainting code Buy = cross(close,EMA(close,14));

   There is always a chance to produce false signals.

This can be avoided by using Reference in AFL

  x = Ref(close, -1);

  Buy = cross(x,EMA(close,14));




(Authorized vendor of NSE supporting realtime data feeds to Amibroker,Metastock and Ninjatrader)