PI CODE- for backtesting

Hi, please help me with this code for PI backtesting

  1. BUY when candle closes above three SMA 20 , SMA 40 and SMA 60

  1. SELL when candle closes below three SMA 20 , SMA 40 and SMA 60

image

for the above given condition you can write
For buy:

CLOSE> SMA(CLOSE,20) AND CLOSE> SMA(CLOSE,40) AND CLOSE> SMA(CLOSE,60)

for sell:

CLOSE< SMA(CLOSE,20) AND CLOSE< SMA(CLOSE,40) AND CLOSE< SMA(CLOSE,60)

1 Like

Thank you for your help