I could not make use of lines posted by Mayur. That is the more appropriate afl. I just put these conditions to make custom afl for time being(serves the purpose). Lets see if somebody post proper afl. Copy paste following lines.
Buy = Close < BBandBot( Close, 20, 2 )*0.98;
Sell = 0;
Short = Close > BBandTop( Close, 20, 2 )*1.02;
Cover = 0;