Yes, it is what I am looking for. Thank you very much for the help.
Best regards, Robert
-------Original Message-------
Date: 01/27/05 03:05:14
Subject: RE: [amibroker] Plot Regression Line
// Copied from the list sometime ago...I think Ed wrote the code
per = Param("LinearRegression Period", 8,2,50,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));
xx = IIf(x > selv - per AND x <= selv, x - (selv - per),Null);
yy = daa + dbb * xx;
Plot (yy, "LinReg", colorBlue );
Plot (C,"",colorWhite,64);
|