Pi-Scanner - Code for buy or sell signal help pls

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

Buy Signal: EMA Cross over 5 and 15 when RSI is above 50 and MACD cross over 0 line

Sell Signal: EMA cross over 15 and 5 when RSI is below 50 and MACD cross below 0 line

My other questions is, In Scanner settings i can see only one place for the code? How can we put buy and sell signal in one place?
Appreciate your help

Thanks,
Sridhar

BUY SIGNAL:

SET MA1 = EMA(CLOSE, 5)
SET MA2 = EMA(CLOSE, 15)
SET A = MACDSignal(13, 26, 9, EXPONENTIAL)

CROSSOVER(MA1, MA2) = TRUE AND RSI(CLOSE,15)<50 AND A>0

SELL SIGNAL:

SET MA1 = EMA(CLOSE, 5)
SET MA2 = EMA(CLOSE, 15)
SET A = MACDSignal(13, 26, 9, EXPONENTIAL)

CROSSOVER(MA2, MA1) = TRUE AND RSI(CLOSE,15)<50 AND A<0

To generate Buy sell signals create a New expert adviser write this code in Artificial Intelligence and you can backtest in Alerts>Backtest.

When I backtested it is giving more than 50% profit in Last 30 Days

Thanks

As per the above condition.

For Buy Script:

CROSSOVER(EMA(CLOSE,5),EMA(CLOSE,15)) AND RSI(CLOSE,14)>50 AND MACD(13, 26, 9, SIMPLE)>0

For Sell Script:

CROSSOVER(EMA(CLOSE,15),EMA(CLOSE,5)) AND RSI(CLOSE,14)<50 AND MACD(13, 26, 9, SIMPLE)<0

In the Scanner you can only scan one script at a time. so you can open two different scanners (one for buy and another for sell)

1 Like

Thanks Mate…

Thanks Mate… Now I got the answer. So we need to run two scanners at a time for buy and sell signals…
Thanks a lot for the information.