Yeah!!! I managed to do this. So for benefit for all others who may be struggling for custom indicators you can do this. Just put a range of candles from 0 to may be 5, this would ensure the repainting issues to be resolved. Thx for all those who tried to help.
And especially fxdreema who practically has made this invincible systems which is unmatched !!!