Download MetaTrader 5

Filter false signals

To add comments, please log in or register
subsoft
7
subsoft  

Hi all,

I am new to MQL4, I am creating a simple indicator as most newbies would do - 2 MA cross signal

Logic:

BUY - > When MA 20 cross MA 50 from below =  arrow up

SELL - > When MA 20 cross MA 50 from top =  arrow down

Indicator is almost done and is working, but i am getting quite a few multiple buy and sell signals when MA crosses frequently

How can i avoid getting false signals without incorporating any new oscillator​s i.e. RSI or ATR  

Thanks for your help 

Jack Thomas
2163
Jack Thomas  

subsoft:

How can i avoid getting false signals without incorporating any new oscillator​s i.e. RSI or ATR 


Multiple time frame analysis is your friend.

- Jack

Anthony Garot
120
Anthony Garot  
How can i avoid getting false signals without incorporating any new oscillator​s i.e. RSI or ATR  

One thought that comes to mind is to ensure the difference between MA(20) and MA(50) is greater than a threshold.

So, in pseudo code

const double THRESHOLD = 0.0001;

if ( MA(20) crosses MA(50) && MathAbs(MA(20)-MA(50)) > THRESHOLD )

{

buy();

}

Dua Yong Rew
5538
Dua Yong Rew  

the moving average changes as the price moves up and down

it is correct that the moving average can cross multiple times

you can either enter on the first cross and block the rest or based on other conditions.

To add comments, please log in or register