How to backtest and get alerts in pi with this code

Buy script

REF (CLOSE, 1) > REF (OPEN,1) AND
REF(CLOSE,2) > REF(OPEN,2)

Sell script

SET C = HIGH-OPEN
TREND(CLOSE,10)=UP
A>=10*B
AND C/B<1
AND REF(CLOSE,1)<REF(OPEN,1) AND
OPEN<REF(CLOSE,1)

in sell script   AND   have to use to connect TREND with Expression  correct it

SET C = HIGH-OPEN
TREND(CLOSE,10)=UP AND
A>=10*B
AND C/B<1
AND REF(CLOSE,1)<REF(OPEN,1) AND
OPEN<REF(CLOSE,1)

For backtesting

​go to alerts -> backtest ,  give profile name periodicity , bar interval and  days  with script symbol and enter above buy and sell scripts and click on back test.

for create scripted alerts go to alerts-> create scripted alerts and add the same and click on enable alerts

check below links for demo in detail
https://www.youtube.com/watch?v=Hg5iZzvBV1A