[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Polynomial Trendlines



PureBytes Links

Trading Reference Links

Will do!  Thanks, Ed.

Dan

--- In amibroker@xxxxxxxxxxxxxxx, "Ed Hoopes" <reefbreak_sd@xxx> 
wrote:
>
> Dan,
> 
> Try a weighted average of 2 LinearRegression's like:
> 
>     Composite = 2*LR(10) + 1*LR(20) / 3
> 
> Put in lengths&weights appropriate for your time frame.  
Backtesting
> this will of course drive you crazy ! :)
> 
> Ed
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "d_hanegan" <dhanegan@> wrote:
> >
> > Thanks, Ed.  I was hoping to find something that was not quite 
as 
> > jumpy as a linear regression line.  I had typed Closing prices 
into 
> > Excel and charted Poly Lines and it looks like it has SOME 
promise.  
> > I also checked out the threads on Sigma Bands and they too SEEM 
to 
> > have some viability.  I am not sure how helpful it would truly 
be to 
> > have either.  I'm just after the cat and looking for other ways 
to 
> > skin it.  Thanks again for your input.
> > 
> > Dan
> > 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "Ed Hoopes" <reefbreak_sd@> 
> > wrote:
> > >
> > > I have written a least squares fit to a quadratic equation.  
It was
> > > quite difficult due to the computation of the coefficient of 
the 
> > x^2
> > > term.  The problem is that AB uses single precision math, and 
the
> > > computation would 'blow up' every so often because the coeff 
of 
> > x^2 is
> > > the difference between two very large numbers.  
> > > 
> > > I used the technique of Gaussian Elimination and had to create 
a
> > > separate time base to prevent the 'blow up's.  
> > > 
> > > Then, if you want to do backtesting, it is necessary to 
extract 
> > arrays
> > > of price data n-days back, then align and load them in with the
> > > artificial time base array before you start the Gauss. It is 
really
> > > quite messy, but I was able to make it work eventually.
> > > 
> > > So of course the REAL question is if it works better than - 
say - a
> > > linear regression which Tomasz has kindly pre-programmed for 
us. 
> > > Being slightly 'bendy' because it is a section of a parabola, 
> > entries
> > > occur a bar or two earlier, and exits are similarly.  Whipsaws 
are
> > > also a little increase because of the flexability.  In all, it 
> > works
> > > better than a linear regression, but not a lot better.
> > > 
> > > The code is not available - as it is used commercially.
> > > 
> > > ReefBreak
> > > 
> > > --- In amibroker@xxxxxxxxxxxxxxx, "d_hanegan" <dhanegan@> 
wrote:
> > > >
> > > > Hello All:
> > > > 
> > > > Sigma Bands aside, has anyone seen or done any work on nth 
order 
> > > > Polynomial Trendlines?
> > > > 
> > > > Thanks.
> > > > 
> > > > Dan
> > > >
> > >
> >
>