## Polynomial regression

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

### Polynomial regression

Indicator draw a regression curve that is best fits the prices between a starting price point and an ending point.

Parameter [Power] defines power of polynomial which will be used.
[Period] defines range of data on chart.
[Deviation] is used for building band.

If Power=1 we have a linear regression,
if power=2 - quadratic regression and etc.

Power=1:

Power=5:

Formulas for band:
BandUp=Regression+[Deviation]*variance,
BandDn=Regression-[Deviation]*variance, where
variance=sqrt(Sum((Price-Regression)*(Price-Regression)))/Period.

Polynomial_Regression.lua

This version provides you option to choose end points for Polynomial regression.
End Point selection is achieved via "Set Start Date" menu.
Reset menu will return the end point to last period of data stream.
Customizable_Polynomial_Regression.lua

You can notice, End point of Polynomial regression moving average and Polynomial Regression have the same value.
Polynomial regression moving average will therefore show End point of Polynomial regression for each of the historical periods.
Polynomial Regression Moving Average.lua

Polynomial Regression Slope is an indicator based on Polynomial Regression.
viewtopic.php?f=17&t=59565

Alexander.Gettinger
FXCodeBase: Confirmed User

Posts: 3512
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk

### Re: Polynomial regression

Hi Guys,

This is a fantastic indicator! I would like to request two modifications:
1) That the "Power=5" regression type has just two lines based on the centre (red line) instead of the three lines in total that it currently displays. And:
2) That this new second line is set N horizontal deviations/periods back from the first (red line), thereby giving crossover signals.

Is this possible? I hope this is clear, if not then just drop me a line.

If Power 1 = linear regression and Power 2 = quadratic regression, what about powers 3 to 5??

Much love and a big Thank you for all your hard work. XX
lisa_baby_xx
lisa_baby_xx

Posts: 76
Joined: Sun Apr 17, 2011 5:37 am

### Re: Polynomial regression

lisa_baby_xx wrote:Hi Guys,

This is a fantastic indicator! I would like to request two modifications:
1) That the "Power=5" regression type has just two lines based on the centre (red line) instead of the three lines in total that it currently displays. And:
2) That this new second line is set N horizontal deviations/periods back from the first (red line), thereby giving crossover signals.

Is this possible? I hope this is clear, if not then just drop me a line.

If Power 1 = linear regression and Power 2 = quadratic regression, what about powers 3 to 5??

Much love and a big Thank you for all your hard work. XX
lisa_baby_xx

"Power" defines power of polynomial which will be used.
Alexander.Gettinger
FXCodeBase: Confirmed User

Posts: 3512
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk

### Re: Polynomial regression

Hello Alex,

The changes/modifications are as follows:
- The two blue lines (top and bottom) on Polynominal Regression type 5 are removed.
- The first red line (centre) has a second line set N horizontal periods back but still in syncronization with the first (red) line, thus allowing for trend crossovers.
-Could this new line, have custom colour and line type just the first red line??

I hope this is clear, if not not just drop me another line.

Many thanks and much love. XX
lisa_baby_xx
lisa_baby_xx

Posts: 76
Joined: Sun Apr 17, 2011 5:37 am

### Re: Polynomial regression

What is the best TF to apply this and the recommended setting? I tried this on 15M (96,5,2) but the curve change quite dramatically during whipsaw/volatility period. Is the angle suggest the direction of the trend as well?

Cheers..
BC
Blackcat2
FXCodeBase: Initiate

Posts: 118
Joined: Wed May 19, 2010 12:42 am

### Re: Polynomial regression

Hi Blackcat2,

The indicator settings you are using look okay to me, try using a bigger timeframe. I have found that using a 30m TF reduces the whipsaw factor. But remember: 80% of money made on the financial markets is make through pure speculation, that means checking economic annoucements and anticipating price movement.

Hope this helps, sweetie.

Much love. XX
lisa_baby_xx
lisa_baby_xx

Posts: 76
Joined: Sun Apr 17, 2011 5:37 am

### Re: Polynomial regression

Thanks Lisa

What settings and TF do you used? Do you use other indicator to confirm? If yes, could you please share?

BC
Blackcat2
FXCodeBase: Initiate

Posts: 118
Joined: Wed May 19, 2010 12:42 am

### Re: Polynomial regression

Hi BC,

What settings and TF do you used? Do you use other indicator to confirm? If yes, could you please share?

Okay, the setting I am using are: 115, 3, 1.7 and Power #3, TF is 30 Minutes (although these can change). As for confirmation, I do not really use anything except the ZIGZAG, but thats mainly for directional reasons because it filters out a lot of noise.

Remember: Nothing is guaranteed

Hope this helps, sweetie.
lisa_baby_xx
Last edited by lisa_baby_xx on Wed May 04, 2011 7:09 am, edited 1 time in total.
lisa_baby_xx

Posts: 76
Joined: Sun Apr 17, 2011 5:37 am

### Re: Polynomial regression

Strategy based on this indicator: viewtopic.php?f=31&t=4105
Alexander.Gettinger
FXCodeBase: Confirmed User

Posts: 3512
Joined: Wed Mar 31, 2010 9:40 pm
Location: Russia, Omsk

### Re: Polynomial regression

Hello Alexander,

Any suggestions?

Thanks,

RJH
Attachments
RJH501

Posts: 84
Joined: Mon May 30, 2011 8:38 pm

Next