Younus, seems that you are doing intraday trading and hence using intraday data and have this issue of ZERO range bar.
My sincere suggestion, you have proble with your data provider. If you are intraday trader, then u got to have good intraday data to make efficient decision. By changing the AFL given by Anant, u may get your AFL to run correctly, but in my view, you are fooling yourself by ignoring 1 bar in between due to lack of data.
Now-a-day, u can fairly good intraday data from investbulls and other feed providers for as low as 350 rs a month. I am sure, as a intraday trader, u pay lot more then this as your stoploss, or brokerage etc. So plz don't cut corner and try to penny wise and pound foolish. Better to get good data feed.
Hope this helps.
Happy Trading