Hello,
I'm failing to formulate a condition on Risk-reward properly. I'm going wrong somewhere. I want to incorporate RRR parameter in order to minimize trading signals, but the filter is not working properly.
Trading signal is very simple: I'm looking for price to simply close above 20EMA, but want to filter signal, as is indicated earlier, using RRR profile (please find a chart attached).
Expert Advisor (I incorporated below formula by editing _Price indicator viz. on default chart)
Buy = Close>EMA(Close,20) AND 0.75*(High-Low)<(HHV(High,20)-High);
Short = Close<EMA(Close,20) AND 0.75*(High-Low)<(Low-LLV(Low,20));
Scanner
Below is the formula I used for Scanning of chart. I modified formula so that signal appears on close of candle.
Buy = Ref(Close,-1)>Ref(EMA(Close,20),-1)
AND 0.75*(Ref(High,-1)-Ref(Low,-1))<(Ref(HHV(High,20),-1)-Ref(High,-1));
Short = Ref(Close,-1)<Ref(EMA(Close,20),-1)
AND 0.75*(Ref(High,-1)-Ref(Low,-1))<(Ref(Low,-1)-Ref(LLV(Low,20),-1));
Please help!