Cross over 20 70 not working

Backtes work but live scanner not working pi terminal can i write this script another way. Plz help

the above tradescript is correct and its working for me, scanner works on live LTP prices and backtest done on historical OHLC values, also note that scanner alerts will not reflect on generated alerts window, when ever the condition matches it gives alert with change in color indicator and alert time