MACD crossover, RSI above 50 and 20 SMA crossing over 50 and 200SMA

HI i’m looking for the aforementioned scanner on pi. i’ve tried using these codes
MACDSignal(12, 26, 9, SIMPLE) > MACD(12, 26, 9, SIMPLE) AND RSI(CLOSE, 14) > 55 AND CROSSOVER(SMA(CLOSE, 20), SMA(CLOSE, 50), SMA(CLOSE, 200))

anything wrong in this code?? i’ve tested but its not giving me the right results or maybe i’m wrong. let me know how could i fix this?

Thank you

This might not work as you intended because MACD is more lagging than SMA.

For better execution of your strategy, use only the SMA crossover and RSI for your signal and then check for MACD condition manually on the graph. This will also be a bit lightweight on Pi.
CROSSOVER(SMA(CLOSE, 50), SMA(CLOSE, 200)) AND RSI(CLOSE, 14) > 55

And you dont need to check for crossover of 3 trends. If SMA 50 and 200 crosses over, SMA 20 and 50 would have already crossed over by default :slight_smile:

thanks a lot