To use chat, please login.
Back to contacts

Trend Definition

Yurin92
Jan 19 2016 at 07:41
8 ieraksti
Hi there! I hope you all are having a nice day. My question is: How do you define what a trend is? How do you determine if an asset is in trend or just in a side movement?

I am trying to programm an strategy, but I need to set the EA to work only when there is a trend. Or at least when the price is not moving sideways. How would you do it? Would you use an indicator? In what way? Or how would you code the 'price action' to determine if the price is on trend or not.

Thank you very much in advance.

jimcameron
Jan 20 2016 at 15:59
20 ieraksti
Hi, I use a moving average to confirm trends, for your EA it might be an easy way to keep you out of a sideways market. It also keeps me from trading in the wrong direction, I prefer trading with the trend. The hard part is catching the start of the trend, maybe this can lead to more discussion.

Hope this helps.

CrazyTraderfx (CrazyTrader)
Jan 20 2016 at 17:35
1718 ieraksti
Yo,

The best trendy pair in a market can be identified when you have a strong currency vs weak currency.
Have a look at current Market
CAD is the getting realy weak since weeks while JPY is the strongest on the market since 2 weeks.
You have 8 currencies (major) that produces 28 pairs.
The most trendy pair is therefore CADJPY among 28:
Look at the last down move on CadJpy... it can't retrace up:

https://www.myfxbook.com/forex-charts/CADJPY,D1/22586

You have free Indi on ForexFactory called Currency Strenght Analyser that will do this job for you real time... you can be inspired of to build yours based on longer term rather than live data.

Good luck
CrazyTrader

Yurin92
Jan 21 2016 at 08:04
8 ieraksti
Hi there! First thank you very much both of you for your time and help. But I'm afraid, you have not understand the problem I have.

jimcameron posted:
Hi, I use a moving average to confirm trends, for your EA it might be an easy way to keep you out of a sideways market. It also keeps me from trading in the wrong direction, I prefer trading with the trend. The hard part is catching the start of the trend, maybe this can lead to more discussion.

Hope this helps.


Yes. I'm already using a moving average. But it only tells me the direction of the 'trend' (price). When the price is above the MA, the price 'is going up', and when the price is under the MA, the price 'is going down'. But what I really need is to programm a filter that tells me if there is a trend or if the price is moving sideways, not a filter that tells me the direction. When the price is moving sideways, the price will still be above or under the MA, and I will get false signals, when the price is in the zone I programm. Do you understand what I mean?

CrazyTrader posted:
Yo,

The best trendy pair in a market can be identified when you have a strong currency vs weak currency.
Have a look at current Market
CAD is the getting realy weak since weeks while JPY is the strongest on the market since 2 weeks.
You have 8 currencies (major) that produces 28 pairs.
The most trendy pair is therefore CADJPY among 28:
Look at the last down move on CadJpy... it can't retrace up:

https://www.myfxbook.com/forex-charts/CADJPY,D1/22586

You have free Indi on ForexFactory called Currency Strenght Analyser that will do this job for you real time... you can be inspired of to build yours based on longer term rather than live data.

Good luck
CrazyTrader


Yes, CrazyTrader. That's a nice idea. I have my EA working on 'this kind' pairs (NZD/USD,AUD/USD, GBP/EUR...). But I need to programm that. I would like it to work by itself. I don't want to be there and when I get a signal, look at the chart and the pair, and the decide if I open or not an order... I think your idea is really good, but I still don't know how I could apply it in code form.

Thank you very much again. And have a nice day!

jimcameron
Jan 21 2016 at 11:07
20 ieraksti
Hi,

“I am trying to programm an strategy, but I need to set the EA to work only when there is a trend. Or at least when the price is not moving sideways ”.

I find the correct MA (for your strategy), is a simple way for the EA to trade when there is a trend, I use an MA, it is flat in a sideways market and when a trend is established it has an up or down direction, so regarding your question, it works for me when there is a trend. It helps me to filter out noise.

 “When the price is above the MA, the price 'is going up', and when the price is under the MA, the price 'is going down”.

Price can be above the MA and going down, or below the MA and going up, the MA tells me when the current price is trending strong enough for me to trade, to me everything else is noise. I don't use price crossing MA's as a signal.

Have you tried setting an MA on your chart and time frame that you use for your system that is flat when you consider the market to be sideways, when the price breaks out the MA will move after price, it could help to stop false signals but you will be chasing the price. I think its better to avoid lots of false breakouts and to hop on the trend a bit later, then ride that wave as far as it goes...

Are you trying to catch breakouts?.

CrazyTraderfx (CrazyTrader)
Jan 21 2016 at 11:43
1718 ieraksti
Here I show you my Indi I use for such purpose compared to the one delivered from this guy:

https://www.forexfactory.com/showthread.php?p=8286367#post8286367

You can download his indi i guess

My CSA is embeded into another Indi of mine that you can also download there:

https://www.forexfactory.com/showthread.php?p=8700290#post8700290
In this thread, you can find exemple on how to use CSA. (read through)

Then you can get inspired of to build yours... It will help you to trade the right pair.


Cheers

Yurin92
Jan 21 2016 at 21:10
8 ieraksti
jimcameron posted:
Hi,

“I am trying to programm an strategy, but I need to set the EA to work only when there is a trend. Or at least when the price is not moving sideways ”.

I find the correct MA (for your strategy), is a simple way for the EA to trade when there is a trend, I use an MA, it is flat in a sideways market and when a trend is established it has an up or down direction, so regarding your question, it works for me when there is a trend. It helps me to filter out noise.

 “When the price is above the MA, the price 'is going up', and when the price is under the MA, the price 'is going down”.

Price can be above the MA and going down, or below the MA and going up, the MA tells me when the current price is trending strong enough for me to trade, to me everything else is noise. I don't use price crossing MA's as a signal.

Have you tried setting an MA on your chart and time frame that you use for your system that is flat when you consider the market to be sideways, when the price breaks out the MA will move after price, it could help to stop false signals but you will be chasing the price. I think its better to avoid lots of false breakouts and to hop on the trend a bit later, then ride that wave as far as it goes...

Are you trying to catch breakouts?.


Thank you very much again. I think I understand now, what you meant. And yes, I thought about that idea. I stady maths, so my initial idea was to take the derivate of a MA and in case it was zero or near zero, that would be a sideways movement. The problem is, that I don't know how to programm the derivate of an MA in MQL4.

My EA follows the trend avoiding corrections with the MACD. That's why I need to filter trend and sideways movements: to avoid false signals I get on sideways movements.

I have thought about something else. And that's a triple EMA: 7, 14, 100 periods. That way when EMA(7)>EMA(14)>EMA(100) the price is 'trending up', and when EMA(7)<EMA(14)<EMA(100) the price is 'trending down'. Else is sideways or correction.

Thank you very much.

PS: I know all that is not always so, and there even with that false signals. But I minimise them.

jimcameron
Jan 23 2016 at 10:10
20 ieraksti
Sounds interesting, good luck with your system.

RobotFX (robotfxea)
Jan 28 2016 at 07:58
20 ieraksti
Yurin92 posted:
Hi there! I hope you all are having a nice day. My question is: How do you define what a trend is? How do you determine if an asset is in trend or just in a side movement?

I am trying to programm an strategy, but I need to set the EA to work only when there is a trend. Or at least when the price is not moving sideways. How would you do it? Would you use an indicator? In what way? Or how would you code the 'price action' to determine if the price is on trend or not.

Thank you very much in advance.


Basically HH & HL = uptrend and LH & LL = downtrend. I personally use MA. For me the uptrend is when the price is above the 200sma and the 30ema>55ema. Vice-versa for downtrend. But these may have different values depending on the timeframe or the chart I use (candlestick, renko etc).
Hope it helps.

“If 90% of the traders are losing their money, do you really want to follow the same rules they do?!”
AliForexTalks
Nov 13 2021 at 16:20
94 ieraksti
A trend is a long-term tendency for prices to move in a certain way. Long-term, short-term, upward, downward, and even sideways trends are all possible. The investor's ability to spot trends and position themselves for profitable entry and exit points is critical to their success in the FX market.

Lūdzu ienāciet, lai komentētu.