Buy Sell Signal For Pi

I am looking for a PI’s scanner or back test code to generate buy and sell signals.

Buy Signal: MACD Bellow 0 & average Cross and EMA Cross over 5 and 20

Exit Profit Buy value to 1 %

Sell Signal: MACD Up 0 & average Cross and EMA Cross over 20 and 5

Exit Profit : Sell value to 1 %

Appreciate your help
Thanks,

As per the above condition

BuyScript:

MACD(13, 26, 9, SIMPLE)<0  AND SMA(CLOSE,14)>0 AND CROSSOVER(EMA(CLOSE,5),EMA(CLOSE,20))

Exit Buy:

(MACD(13, 26, 9, SIMPLE)<0  AND SMA(CLOSE,14)>0 AND CROSSOVER(EMA(CLOSE,5),EMA(CLOSE,20)))* 1.01

SellScript:

MACD(13, 26, 9, SIMPLE)>0  AND SMA(CLOSE,14)>0 AND CROSSOVER(EMA(CLOSE,20),EMA(CLOSE,5))

Sell Exit:

(MACD(13, 26, 9, SIMPLE)>0  AND SMA(CLOSE,14)>0 AND CROSSOVER(EMA(CLOSE,20),EMA(CLOSE,5)))* 1.01

Note that you can only scan one script at a single time.