Angle / Slope between price and MA

 

Hi,

I want to detect if for an up trend, the slope of the lows is higher than the slope of a moving average (slope of the highs for a down trend).

Or any system that will tell me if the slope of a MA is bigger than the slope of an other MA or which will give me the angle between the two MA.

Has anybody an idea on how to do that?

Cheers,

Daniel

 

Hi,

Thank you for replying!! :-))

Well, if we look at the bullish trend on the left side of the chart, we can see that the green line has a bigger slope than the blue line and is actually going away from it.

I could compute the difference between the two lines and check if it's increasing over a given period, but how to do if that difference is really noisy and moving around an "average value"? I think I need something like a regression line, but I don't know how to compute it or if there are existing indicators doing that.

I know there is way, given a set of points, to build the best line approximating the points. Is there a way to do that? Is an indicator already doing something like that?

Cheers,

Daniel

 

hi, Dvarrin!

could you explain your idea with the charts?

(slope indicators: https://www.mql5.com/en/forum/176241)

Files:
slope_lr.gif  23 kb
slope_ama.gif  19 kb
 

well, what about macd (12,26,9)- distance between 12 &26 emas ; AO; (alligator); 3/10... ?

 
dvarrin:
Hi,

Thank you for replying!! :-))

Well, if we look at the bullish trend on the left side of the chart, we can see that the green line has a bigger slope than the blue line and is actually going away from it.

I could compute the difference between the two lines and check if it's increasing over a given period, but how to do if that difference is really noisy and moving around an "average value"? I think I need something like a regression line, but I don't know how to compute it or if there are existing indicators doing that.

I know there is way, given a set of points, to build the best line approximating the points. Is there a way to do that? Is an indicator already doing something like that?

Cheers,

Daniel

Yes ,you need to calculate the angle/slope of the linear regression ,there is already a linear regression slope indicator out there :https://www.mql5.com/en/forum/174257

 

been playing with slopes: here's another nice LR (TSCD) ind in addition 2 Igorad's & Kalenzo's ama

Files:
 

Trend Angle Direction Using Moving Averages

I just created this for you. It has taken me a long time to figure out how to check for Flat or Trending Markets. This should fill the bill, sort of speaking.

Enjoy!
Rev Dave <<<

Question: Do you have the assurance, the guarantee, the confidence that you will go to Heaven if you would die today?? If you do not, you can - talk to me further about true salvation and the guarantee of Heaven.

ddiebold7@aol.com

 

Hi,

Thanks a lot to all of you!! I have plenty of things to check now

They all seem to be really good indicators for what I need

GREAT THANKS TO YOU ALL AND FOR YOUR CODE 1DAVE7!!

 

Slope of Two Lines

I would like to know the slopes of two moving averages (or other line indicators) and then compare them to one another. Can this be done in MT4 and if so, has someone already done this? If you have, do you mind sharing the code for this? thanks

 

and these ones Slow of Linear Regression line and Angle of Exponential moving average.

Cheers

~drgoodvibeemaanglezero.mq4linearregslope_v1.mq4

 

Thanks

Drgoodvibe, thank you very much. I have not had time to look at these yet, but will later this week. Thanks again. jdp2012

Reason: