Convert Tradingview strategy(pineScript) to zerodha pi script

Need to convert one strategy from trading view to pi equivalent version :

Tradingview strategy : 

tim=input('160') 
out1 = security(tickerid, tim, open) 
out2 = security(tickerid, tim, close) 
plot(out1,color=red) 

plot(out2,color=green) 

longCondition = crossover(security(tickerid, tim, close),security(tickerid, tim, open)) ​

shortCondition = crossunder(security(tickerid, tim, close),security(tickerid, tim, open)) 

For the above given condition

Buy:

OPEN > CLOSE

Sell:

OPEN < CLOSE

you can also specify your condition directly 

1 Like

How to add time factor in it ?
Ex. when open > last 120Min high => then generate Buy Signal.