Page 1 of 5

Polynomial regression

PostPosted: Wed Mar 23, 2011 9:38 pm
by Alexander.Gettinger
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:
PR1.png


Power=5:
PR2.png


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

Download:
Polynomial_Regression.lua
(4.5 KiB) Downloaded 3341 times


Last.png

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
(9.19 KiB) Downloaded 775 times


Polynomial Regression Moving Average.png

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
(3.48 KiB) Downloaded 736 times


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

Polynomial regression Range With Alert.lua
(12.59 KiB) Downloaded 28 times

Re: Polynomial regression

PostPosted: Tue Apr 26, 2011 10:13 am
by lisa_baby_xx
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

Re: Polynomial regression

PostPosted: Tue Apr 26, 2011 9:25 pm
by Alexander.Gettinger
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


Please explain me about modifications.
"Power" defines power of polynomial which will be used.

Re: Polynomial regression

PostPosted: Wed Apr 27, 2011 4:50 am
by lisa_baby_xx
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. ;) :D

Many thanks and much love. XX
lisa_baby_xx

Re: Polynomial regression

PostPosted: Wed Apr 27, 2011 6:27 pm
by Blackcat2
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

Re: Polynomial regression

PostPosted: Fri Apr 29, 2011 8:01 am
by lisa_baby_xx
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

Re: Polynomial regression

PostPosted: Sun May 01, 2011 7:09 pm
by Blackcat2
Thanks Lisa :)

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

BC

Re: Polynomial regression

PostPosted: Mon May 02, 2011 5:35 am
by lisa_baby_xx
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

Re: Polynomial regression

PostPosted: Wed May 04, 2011 1:40 am
by Alexander.Gettinger
Strategy based on this indicator: viewtopic.php?f=31&t=4105

Re: Polynomial regression

PostPosted: Fri Jul 22, 2011 7:35 am
by RJH501
Hello Alexander,

The indicator loads up just fine but the strategy won't load.

Any suggestions?

Thanks,

RJH