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

Re: linear regression



PureBytes Links

Trading Reference Links

Maybe Im ready for the 'knackers yard' - approaching 60 years old and 
probably about the same IQ but even now I remember the equation to a 
straight line.
Putting it into afl is another matter. What I dont appear to have in 
my version (4.02) is LinRegIntercept - as far as I can see.

I downloaded V4.19 but didnt see it there either. I will have another 
look when I get home from work. Can anyone confirm its there?

Sorry to be a nuisance to you experts.


--- In amibroker@xxxx, "Herman van den Bergen" <psytek@xxxx> wrote:
> ....> Excuse me but this is elementary school math...
> 
> Right you are Tomasz :-) but for me that is almost half a century
> ago....ooops, now I gave my age away :-(
> 
> Thanks for the refresher though! It is much appreciated.
> 
> Herman.
> 
> > -----Original Message-----
> > From: Tomasz Janeczko [mailto:amibroker@x...]
> > Sent: 14 October, 2002 7:13 AM
> > To: amibroker@xxxx
> > Subject: Re: [amibroker] Re: linear regression
> >
> >
> > Excuse me but this is elementary school math.
> >
> > y = a + b * x
> >
> > a is a intercept (in AFL LinRegIntercept)
> > b is a slope (in AFL LinRegSlope)
> >
> > The AFL formula:
> >
> > x = Cum(1);
> > lastx = LastValue( x );
> >
> > Daysback = 10;
> >
> > aa = LastValue( LinRegIntercept( Close, Daysback) );
> > bb = LastValue( LinRegSlope( Close, Daysback ) );
> >
> > y = aa + bb * ( x - (Lastx - DaysBack) );
> >
> > Plot( Close, "Close", colorBlack, styleCandle );
> > Plot( y, "LinReg", colorRed );
> >
> >
> > If you want only the last bar display you can use:
> >
> > x = Cum(1);
> > lastx = LastValue( x );
> >
> > Daysback = 10;
> >
> > aa = LastValue( LinRegIntercept( Close, Daysback) );
> > bb = LastValue( LinRegSlope( Close, Daysback ) );
> >
> > y = Aa + bb * ( x - (Lastx - DaysBack) );
> >
> > Plot( Close, "Close", colorBlack, styleCandle );
> > Plot( IIf( x >= (lastx - Daysback), y, -1e10 ), "LinReg", 
colorRed );
> >
> >
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message -----
> > From: "Herman van den Bergen" <psytek@xxxx>
> > To: <amibroker@xxxx>
> > Sent: Monday, October 14, 2002 8:49 PM
> > Subject: RE: [amibroker] Re: linear regression
> >
> >
> > > Hello,
> > >
> > > I think Don is looking for the straight line LinReg equation, 
there have
> > > been a few versions posted but they all had some problems under 
certain
> > > conditions.
> > >
> > > It would be nice to have a straight line LinReg from point A to
> > B formula,
> > > anybody good in math?
> > >
> > > Best regards,
> > > Herman.
> > >
> > > > -----Original Message-----
> > > > From: gillesdeprez [mailto:gillesdeprez@x...]
> > > > Sent: 14 October, 2002 2:05 AM
> > > > To: amibroker@xxxx
> > > > Subject: [amibroker] Re: linear regression
> > > >
> > > >
> > > > Hello,
> > > > I think the function LinearReg (Array, Period) came with the 
4.14
> > > > version;
> > > > Friendly,
> > > > Gilles
> > > >
> > > >
> > > > --- In amibroker@xxxx, "doedau" <doed@xxxx> wrote:
> > > > > Hi,
> > > > > My version of AB (4.02)has slope of linear regression line
> > > > > (linregslope) not the line of linear regression itself. 
Have I
> > > > missed
> > > > > it, has anyone written afl for it, or is it in a later 
version? I
> > > > see
> > > > > references to regression in latest version but my maths not 
up to
> > > > > knowing if this is the same thing as conventional linear 
regression.
> > > > > Many thanks for any help in advance. Regards, Don.
> > > >
> > > >
> > > >
> > > > Post AmiQuote-related messages ONLY to: amiquote@xxxx
> > > > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > > >
> > > > Check group FAQ at:
> > > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > >
> > > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
> > >
> > >
> > >
> > > Post AmiQuote-related messages ONLY to: amiquote@xxxx
> > > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > >
> > > Check group FAQ at:
> > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > >
> > > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
> >
> >
> >
> > Post AmiQuote-related messages ONLY to: amiquote@xxxx
> > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> >
> > Check group FAQ at:
> > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> >
> > Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/
> >
> >
> >