Streal algo execution problem

Hi Zerodha,
Recently i started using sreak algo and tried to write a algo and backtest the same algo but to my surprise i’m getting very confusing results, as i have tried all the combination i can but still problem persist , My main problem is that the algo doesnot gives the buy signal as it should in the given time frame and as per my algo, so i request you to kindly look into the slgo and let me know is there anything that i’m missing in algo.