The reason that the line doesn't appear to fit is that by default it
appears to be fitting all of the data in the array to the polynomial.

I have tried different order equations and found that 2nd order
(quadratic) works the best for me.  The number of bars for the fit I
set to between 20 and 50  -  which it appears you can do with this code.  

A few things you can do is
1. Take the first derivative of the resulting equation to produce the
slope at the last data point, and use the normalized slope (%-per-day)
as a ranking indicator.
2. Check the slope at the beginning, middle, and end of the array to
search for cup-and-handle patterns. Actually you use a long one
(50-100 bars shifted back 20 bars) for the cup and a short one (10-20
bars not shifted) for the handle.  then create a search based on the
shape(slopes) of the resulting parabolas.
3. Create an indicator that consists of the last value of the slope of
a n-bar set of going back to the start of the data.  This produces a
nice smooth oscillator indicating tops & bottoms in price.

Ed Hoopes




--- In [email protected], "d_hanegan" <[EMAIL PROTECTED]> wrote:
>
> Fred:
> 
> Thanks for your posts and all of the information concerning the 
> Polynomial Trendlines.  When I run the code, I pretty much just get 
> a straight green line; it does not fit my data.  I thought I had 
> read all of the posts.  Am I missing something? 
> 
> Thanks.
> 
> Dan
> --- In [email protected], "Fred" <ftonetti@> wrote:
> >
> > Be AWARE ... that was a hand picked image ... if you play with 
> > PolyFit you will see that sometimes data fits the extrapolations, 
> > sometimes it doesn't.
> > 
> > The higher the order, the flakier the extrapolations are likely to 
> > become ...
> > 
> > So ... Remember what it is ... a generator of an equation in the 
> form 
> > 
> > Y = a + bx + cx^2 + ... + nx^(n-1)
> > 
> > Where the coeeficients were pick to fit the data.
> > 
> > IMHO what PolyFit is, epecially with very high orders is a very 
> good 
> > detrender of IN SAMPLE data, nothing more, nothing less ... That 
> in 
> > and of itself is a useful tool ... Gaussian Elimination can also 
> be 
> > the basis for some other things that are pretty decent when the 
> order 
> > is kept fairly low i.e. 3 or 4 ...
> > 
> > --- In [email protected], "Ara Kaloustian" <ara1@> wrote:
> > >
> > > Polynomial TrendlinesFred,
> > > 
> > > There have been a lot of posting on this subject.  Your one 
> image 
> > however is a very powerful message of its potential.
> > > 
> > > Now I have to go back and review all the post ... hoping to find 
> a 
> > good reference to study.
> > > 
> > > Anyone using it succesfully now?
> > > 
> > > Ara
> > >   ----- Original Message ----- 
> > >   From: Fred Tonetti 
> > >   To: [email protected] 
> > >   Sent: Tuesday, October 03, 2006 3:32 PM
> > >   Subject: [amibroker] RE: Polynomial Trendlines
> > > 
> > > 
> > >   Oops .
> > > 
> > >    
> > > 
> > >   Meant to include this visual .
> > > 
> > >    
> > > 
> > >   Green is calculated . White is extrapolated .
> > > 
> > >    
> > > 
> > >    
> > > 
> > > 
> > > 
> > > -----------------------------------------------------------------
> ---
> > ----------
> > >   I am using the free version of SPAMfighter for private users.
> > >   It has removed 8588 spam emails to date.
> > >   Paying users do not have this message in their emails.
> > >   Try SPAMfighter for free now!
> > >
> >
>






Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to