Need code for MACD, RSI and ADX

I need a code for below results.

MACD has a cross over. AND 

RSI is above 60 for buy and below 40 for sell. AND

ADX is above 25 level.

Can anyone guide me if this is a right code or not ? Thanks.

Buy- CROSSOVER(MACD(12,26,9,EXPONENTIAL),MACDSIGNAL(12,26,9,EXPONENTIAL)) AND RSI(CLOSE,14)>60 AND TREND(CLOSE,55)=UP AND ADX(14)> 25

Sell- CROSSOVER(MACD(12,26,9,EXPONENTIAL),MACDSIGNAL(12,26,9,EXPONENTIAL)) AND RSI(CLOSE,14)<40 AND TREND(CLOSE,45)=DOWN AND ADX(14) > 25
1 Like

Yes the above code is correct, :slight_smile:

i tried to copy this code & backtest , nothing appeared .

in the above code the trend of which should to up or down? if we put that i think the code may work…

in the above code the trend of which should to up or down? if we put that i think the code may work…

Sir,
I want to scan the stocks which fulfills the above criteria and in addition I want to add one more term that when price is above 20 DMA. Can you please help me with that ??? Thanks.
I mean I want to apply above code in Pi Scanner.
Pls guide me regarding that.