Ema5/21 + macd + rsi(14) > 50 < 50 afl

Vipul_84

Well-Known Member
#12
Good coding Happy !

Code:
Buy =  EMA(C,5) > EMA(C,21) AND MACD(12,26) > 0 AND RSI(14) > 50;
Sell = EMA(C,5) < EMA(C,21)  OR MACD(12,26) < 0  OR RSI(14) < 50;

Short = EMA(C,5) < EMA(C,21) AND MACD(12,26) < 0 AND RSI(14) < 50;
Cover = EMA(C,5) > EMA(C,21)  OR MACD(12,26) > 0  OR RSI(14) > 50;

Buy  = ExRem(Buy,Sell);					Short = ExRem(Short,Cover);    
Sell = ExRem(Sell,Buy);					Cover = ExRem(Cover,Short);  

PlotShapes(Buy * 1+2*Short,colorWhite,0,IIf(Buy,L,H),-24);
PlotShapes(Cover*3+4* Sell,colorWhite,0,IIf(Cover,L,H));
Such simplistic system do not work consistently in different market conditions.

However it is a good learning step.

Your mother candle concept is much better as you are also using a filter (0.1%) to remove trades based on small range bars . . .

Best :thumb:

Happy :)
 

Similar threads