Trend direction in Forex using MQL4

 
Hi guys,

I want to ask you a few questions about how to identify trend in Forex and which will be the best way to do that in my case, because if I have to be honest I really don't know what to do. It is such a mess in my head after so many articles read (+ MQL4 documentation).

Although I'm a software engineer I'm a newbie in Forex.  In the last few weeks I started developping an MT4 indicator with MQL4. One of the main things my indicator do is to detect trend direction.

I already read this article -  "Several Ways of Finding a trend in MQL5" and some discussions in the forum (for example: "Best method to identify trend in forex"). At the moment my logic is based on Fan Moving Average - I use 3 periods to detect my trend direction, but this doesn't help me...

You are traders... when you have your main chart zoomed out you easily and fast can see where the trend goes:


Example


In the example above is more than obvious that the trend goes UP even that when I use MA sometimes I catch that the trend goes DOWN or UP, or it is UNDEFINED.. but in global perspective it goes UP - I want to do that with MQL4 but I have no idea how to achieve it. Someone in the forum has mentioned that Chart patterns are better than the Candlestick patterns. Moving Average is candlestick patterns, right?

I will really appreciate if you can give me some advice what I could do or just to share your experiance if it is relative with my case.  I am curious to learn something new :)
 
dimitarsd:
Hi guys,

I want to ask you a few questions about how to identify trend in Forex and which will be the best way to do that in my case, because if I have to be honest I really don't know what to do. It is such a mess in my head after so many articles read (+ MQL4 documentation).

Although I'm a software engineer I'm a newbie in Forex.  In the last few weeks I started developping an MT4 indicator with MQL4. One of the main things my indicator do is to detect trend direction.

I already read this article -  "Several Ways of Finding a trend in MQL5" and some discussions in the forum (for example: "Best method to identify trend in forex"). At the moment my logic is based on Fan Moving Average - I use 3 periods to detect my trend direction, but this doesn't help me...

You are traders... when you have your main chart zoomed out you easily and fast can see where the trend goes:




In the example above is more than obvious that the trend goes UP even that when I use MA sometimes I catch that the trend goes DOWN or UP, or it is UNDEFINED.. but in global perspective it goes UP - I want to do that with MQL4 but I have no idea how to achieve it. Someone in the forum has mentioned that Chart patterns are better than the Candlestick patterns. Moving Average is candlestick patterns, right?

I will really appreciate if you can give me some advice what I could do or just to share your experiance if it is relative with my case.  I am curious to learn something new :)

It's very simple.

When the trend is making higher highs, and higher lows, it's an uptrend.

In reverse, when the trend is making lower highs, and lower lows, then it's a downtrend.

 
Lol, I didn't expect to be so simple. I think I can implement that. Thanks :)
 
dimitarsd:
Lol, I didn't expect to be so simple. I think I can implement that. Thanks :)

Also you can use this.

or

this

 https://www.mql5.com/en/forum/74003

 

 

Indicator #Pallada_MainSignal_AllAverages
Indicator #Pallada_MainSignal_AllAverages
  • reviews: 3
  • www.mql5.com
Indicator #Pallada_MainSignal_AllAverages.
Files:
 
Marco vd Heijden:

It's very simple.

When the trend is making higher highs, and higher lows, it's an uptrend.

In reverse, when the trend is making lower highs, and lower lows, then it's a downtrend.


Over how many previous bars do you apply this formula?

 
Success4elcid5:

Over how many previous bars do you apply this formula?

Until it breaks ?

 

You might use a couple of those, different lengths to determine trend on a higher time frame.

Reason: