How to convert strategy into trade script for Pi backtesting

My strategy is EoD strategy
When 14 period ADX is above 35.
BUY: IF- +DI above -DI and Today Fast STOCK %K must close under 40% (Period for %K is 8) ,We will buy tomorrow one tick above today’s high.

Sell If:–DI above +DI and Today Fast STOC %K is close above 60% We will sell short tomorrow (Day two),one tick below today’s low.

Use Day charts as per your condition

Buy Script

DIP(14)>DIN(14) AND SOPK(8, 3, 9, SIMPLE) < 40 AND LAST>REF(HIGH,1)

Sell Script

DIN(14)>DIP(14) AND SOPK(8, 3, 9, SIMPLE) > 60 AND LAST>REF(LOW,1)
1 Like

Thanks buddy…