Regression Analysis - page 8

 
94315jim:
mladen,

Is it possible to display the period to calculate the R-squared of the last closed bar?

thanks,

jim

As a comment (in the main window) or as a label (in the window where it is displayed)?

 

Mladen,

As a label in the R-squared indicator window should be fine.

thanks,

jim

mladen:
As a comment (in the main window) or as a label (in the window where it is displayed)?
 
94315jim:
Mladen,

As a label in the R-squared indicator window should be fine.

thanks,

jim

jim

Here you go : polyfitr-squared_v1.03__cycle_period_nmc.mq4

 

mladen,

Currently, the upper and lower level are "static". Is it possible to make it a function of the period?

If yes, could you use the following equation for now. I will change it later in the code once I am sure what equation to use.

lower level = 100*(1 * ((cycle multiplier * period from cycle period indicator) ^(-1)))

upper level = 100 - lower level

Also, if possible could the indicator in the r -squared window show the upper/lower level.

thanks,

jim

 
94315jim:
mladen,

Currently, the upper and lower level are "static". Is it possible to make it a function of the period?

If yes, could you use the following equation for now. I will change it later in the code once I am sure what equation to use.

lower level = 100*(1 * ((cycle multiplier * period from cycle period indicator) ^(-1)))

upper level = 100 - lower level

Also, if possible could the indicator in the r -squared window show the upper/lower level.

thanks,

jim

jim

The polyfit r-squared is bound to 0 to 100 range (it is normalized). Cycles are not bound nor normalized. In that case you would have two values that are "operating" in a completely different range of values compared and without any actual correlation of the values (not the periods but values)

It would be better to use some other way of making adjustable/dynamic levels

 

mladen,

Could you change the period of the LSMA Angle to be based on the cycle period indicator? Also, could you add a "signal" line?

thanks,

jim

Files:
 
94315jim:
mladen,

Could you change the period of the LSMA Angle to be based on the cycle period indicator? Also, could you add a "signal" line?

thanks,

jim

jim

That indicator is showing a king of a slope of the lsma. Did you see this one : https://www.mql5.com/en/forum/173056/page5 . It is showing angle (as approximation, but it will never be greater than 90 and seems to be good approximation for angles of averages calculation)

 

Wouldn't it be a good idea to combine this with linear regression (as you already did with regular R-squared)?

 
sebastianK:
Wouldn't it be a good idea to combine this with linear regression (as you already did with regular R-squared)?

You means something like LR trend?

Yes, I think it would be a good idea.

 
mladen:
You means something like LR trend? Yes, I think it would be a good idea.

Thanks. I think it will be a useful tool

Reason: