[REQ] Polynomial Regression

 

Hi!

It would be nice to have a polynomial regression indicator in metatrader.

The idea is pretty simple, just like in a simple linear regression, we use the Least Squares method to fit a polynomial instead of the line function.

Simple Linear Regression = b1 + b2 * x

Polynomial Regression = b1 + b2 * x + b3 * (x) ^2 + b4 * (x) ^3 + ... + bn * (x)^n+1

As you increase the degree of the polynomial, the speed gets much faster.

Least Squares Method

I always use the matrix algebra formula here.

Is any coder willing to code this? I would do it myself but im really busy right now.

Thanks in advance,

JCC

 
juanchoc:
Hi!

It would be nice to have a polynomial regression indicator in metatrader.

The idea is pretty simple, just like in a simple linear regression, we use the Least Squares method to fit a polynomial instead of the line function.

Simple Linear Regression = b1 + b2 * x

Polynomial Regression = b1 + b2 * x + b3 * (x) ^2 + b4 * (x) ^3 + ... + bn * (x)^n+1

As you increase the degree of the polynomial, the speed gets much faster.

Least Squares Method

I always use the matrix algebra formula here.

Is any coder willing to code this? I would do it myself but im really busy right now.

Thanks in advance,

JCC

I could be wrong but I think that is exactly what the 'DECEMA' MA indicator does...

 
omelette:
I could be wrong but I think that is exactly what the 'DECEMA' MA indicator does...

No, i've took a look at the DECEMA code and it doesnt look anything like a polynomial regression. Besides, im quite sure that i've tryied most (if not all) of the mt4 indicators around, and never seen a polynomial regression like the one im talking.

 
juanchoc:
No, i've took a look at the DECEMA code and it doesnt look anything like a polynomial regression. Besides, im quite sure that i've tryied most (if not all) of the mt4 indicators around, and never seen a polynomial regression like the one im talking.

Don't you think that digitals filters are exactly what you are looking for ?

 
Michel:
Don't you think that digitals filters are exactly what you are looking for ?

No, while there is some similitude in the mathematical structure (weigthing points with coefficients), the logic behind it is quite diferent. Here you use cohefficients on a linear number series (1,2,3,4,5,6,7,8,9,10,....).

Digital filters apply the weigths to the input itself. Also the method for calculating the coheficients of the digital filters is diferent to the one used here.

Still, i coded most of the functions and logic in the last hour, but it sure has some bugs, because i translated most of the matrix handling functions from .net.

In a few minutes i'll post the indicator, just in case another coder wants to fix it, as i dont have much free time.

 

We have some indicators based on polynomial regression on this thread.

 

And polynomial tools (similar with Jan Arps' Traders' Toolbox Online Store) for MT4 created by Igorad (in elite section).

 

Thanks Linuxser and newdigital! Just found the indicators in the elite section (the Jan Arps ones).

Nice indicators indeed.

 

Polynomial regression

Posting this indicator as is (it is a kind of regression tool after all)

It is made by Ivan Kornilov. Depending on the degree of the regression it is calculating values using linear regression (degree 1), quadratic regression (degree 2) and so on ...

 
mladen:
Posting this indicator as is (it is a kind of regression tool after all)

It is made by Ivan Kornilov. Depending on the degree of the regression it is calculating values using linear regression (degree 1), quadratic regression (degree 2) and so on ...

Thanks Mladen,

Please can you add 2 channels (average true range) on this indicator ??,

Regards.

 
sohocool:
Thanks Mladen,

Please can you add 2 channels (average true range) on this indicator ??,

Regards.

Hi Mladen,

Don't lose your time ,i have find the answer . .

Reason: