Please help with coding of this strategy for backtesting!

Please help me with the coding of below mentioned strategy:

Buy when MACD “Divergence” > 0 (blue line crosses red line)
Sell when MACD “Divergence” < 0 (red line crosses blue line)

Thanks!

Buy :

SET A = MACDSignal(13, 26, 9, SIMPLE)
SET B = MACD(13, 26, 9, SIMPLE)
CROSSOVER(A, B) = TRUE

Sell:

SET A = MACDSignal(13, 26, 9, SIMPLE)
SET B = MACD(13, 26, 9, SIMPLE)
CROSSOVER(B,A) = TRUE