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

[amibroker] LinRegLine Attn: John Z



PureBytes Links

Trading Reference Links

JohnZ - This may be more than you want to know about Linear Regression
but here's another very straight forward routine, from the forum, author unknown.
 
Note that it will draw the line where you place your cursor...with the use of SelectedValue.
 
If you use the line regression tool on the right tool bar you can overlay this
plotline as best I tell by eye. 
 
Hope this helps
JOE  
 
 

_SECTION_BEGIN("LinRegLine");

per = Param("LinearRegression Period", 8,2,260,1);

mm= (H + L) / 2;

x = Cum(1);

lastx = LastValue( x );

selv = SelectedValue(x);

aaa = LinRegIntercept( mm, per);

bbb = LinRegSlope( mm, per );

daa = SelectedValue(ValueWhen( x, aaa, 1));

dbb = SelectedValue(ValueWhen( x, bbb, 1));

show = x > selv - per AND x <= selv;

xx = IIf(show, x - (selv - per),Null);

yy = IIf( show, daa + dbb * xx, Null );

Plot(yy, "LinReg", colorBlue );

Plot(mm,"Price",colorBlack,styleCandle);

 

_SECTION_END();



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





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS




BEGIN:VCARD
VERSION:2.1
N:Landry;Joe
FN:Joe
ORG:Houston Investors Association
TITLE:VP Programs
TEL;WORK;VOICE:281-486-5567
ADR;WORK:;;2222 Cullen;Houston;Texas;77005;USA
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:2222 Cullen=0D=0AHouston, Texas 77005=0D=0AUSA
URL;WORK:http://houstoninvestors.com
EMAIL;PREF;INTERNET:jelandry@xxxxxxxxxxxxx
REV:20060206T150635Z
END:VCARD

Attachment: Description: Binary data