Pi strategy code for stochastics crossover?

Can anyone tell me how to code this strategy in pi backtest…

BUY - when stochastics D (8,3,3) crosses over stochastics K (8,3,3)

SELL - vice versa

As per the above condition

BUY:

CROSSOVER(SOPD(8, 3, 3, SIMPLE),SOPK(9, 3, 9, SIMPLE) )

SELL:

CROSSOVER(SOPK(8, 3, 3, SIMPLE),SOPD(9, 3, 9, SIMPLE) )

Hi AlgoGeek,
Can you tell me what is wrong with this script. The Sell Signals and Exit Shorts are working fine, the Buy and Exit Long signals are not working at all.( Not signals received even after i recheck the Chart to confirm)
Buy – WWS(CLOSE,5) > WWS(CLOSE,8) > EMA(CLOSE,40) > SMA(CLOSE,75) AND MACDSIGNAL (13, 26, 9, EXPONENTIAL) 25 AND ADX(14) >28
SELL – WWS(CLOSE,5) < WWS(CLOSE,8) < EMA(CLOSE,40) < SMA(CLOSE,75) AND MACDSIGNAL (13, 26, 9, EXPONENTIAL) 25 AND ADX(14) >28
Exit Long – MACD(13, 26, 9, EXPONENTIAL) > MACDSIGNAL (13, 26, 9, EXPONENTIAL) AND CLOSE < EMA(CLOSE,40) OR CLOSE < OPEN AND REF (CLOSE, 1) < REF(OPEN, 1) AND REF(CLOSE, 2) < REF(OPEN, 1)
Exit Short – MACD(13, 26, 9, EXPONENTIAL) EMA(CLOSE,40) OR CLOSE > OPEN AND REF(CLOSE, 1) > REF(OPEN, 1) AND REF(CLOSE, 2) > REF(OPEN, 2)
Thank you :smiley:

CROSSOVER(SOPD(8, 3, 3, SIMPLE),SOPK(9, 3, 9, SIMPLE) ) is going down in real market. Pl. advise me in this condition is it right to buy?