Backtest for below condition in PI

I would like backtest to find trades and profits for below condition in PI

if todays open is greater than yesterdays close

so my buy script should be at yesterday’s close and sell script should be at today opening

hElLO tRaDeR,

BUY SCRIPT:

OPEN > REF(CLOSE,1)

In TRADESCRIPT backtest, when your BUY conditions are met, the trade is automatically entered on the next candle's open price, so you cannot manually define yesterdays close price as your entry price or refer to todays open price as your exit strategy. You need to define a candlestick condition for exit.