Looking for some more ideas/help

 

Greetings,

I have an idea for an indicator and am hoping I can find some suggestions here on how to build it. I have gotten very useful help in the past (thanks gordon) and look forward to peoples input.

What I want to do is create an indicator that will plot the slope of 2 or 3 different length linear regression lines in the same separate window. Zero would be the center line and the angular values would be between +180 degrees and -180 degrees. I’m figuring I should use the iCustom function with the !LinRegrBuf.mq4 indicator but, I am not sure how to get the data I need from it to calculate the angles.

I would need the values of 2 different points from each regression line to determine an angle and I would like to make it so that I can alter the length of each of the regression lines being calculated.

Any help is greatly appreciated.
 
rwb181 wrote >>

Greetings,

I have an idea for an indicator and am hoping I can find some suggestions here on how to build it. I have gotten very useful help in the past (thanks gordon) and look forward to peoples input.

What I want to do is create an indicator that will plot the slope of 2 or 3 different length linear regression lines in the same separate window. Zero would be the center line and the angular values would be between +180 degrees and -180 degrees. I’m figuring I should use the iCustom function with the !LinRegrBuf.mq4 indicator but, I am not sure how to get the data I need from it to calculate the angles.

I would need the values of 2 different points from each regression line to determine an angle and I would like to make it so that I can alter the length of each of the regression lines being calculated.

Any help is greatly appreciated.

Hi, look for ObjectGetValueByShift(), maybe is what you are looking for!

 

It's been talked about in other threads, don't use angles. An angle is the ratio of x distance and y distance. On a chart you have price vs time. Different units so angle makes no sense. Furthermore, the scale of both price (auto) and time (bar size manual) are variable, thus angle makes no sense.


Use slopes.

 
WHRoeder:

It's been talked about in other threads, don't use angles. An angle is the ratio of x distance and y distance. On a chart you have price vs time. Different units so angle makes no sense. Furthermore, the scale of both price (auto) and time (bar size manual) are variable, thus angle makes no sense.


Use slopes.

I understand what you are saying but, I want to use it in a way that will work for me.

I have written a code but, it won't display as I was expecting. Could you possibly look at it and show me where my mistake is?

Files:
slopes_1.mq4  3 kb
Reason: