09.12.2012 Views

Charting and Studies User Guide - CQG.com

Charting and Studies User Guide - CQG.com

Charting and Studies User Guide - CQG.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Linear Regression (LinR)<br />

What it does:<br />

Page 179<br />

The Linear Regression tool plots the regression line <strong>and</strong> a st<strong>and</strong>ard error channel, based on the<br />

points you click. The distance away from the LR line for the limit lines is either the maximum<br />

deviation above <strong>and</strong> below the LR line, when the Limit Lines parameter is set to Max Deviation,<br />

or the st<strong>and</strong>ard errors multiplied by the value specified in the Factor parameter when Limit<br />

Lines are set to Factor x StdErr. For example, selecting a factor of .5 would plot each line .5<br />

st<strong>and</strong>ard errors away from the LR line. The St<strong>and</strong>ard Error is defined as: (The sum of the<br />

squares of the deviation from the line)/The number of bars – 1).<br />

St<strong>and</strong>ard mathematics are used for the Linear Regression. The maximum deviation is the price<br />

that is furthest from the linear regression line. For example: If the selected price is close <strong>and</strong><br />

the two selected points are 20 bars apart, the linear regression line is calculated using the 20<br />

closes between the selected points, <strong>and</strong> then the maximum deviation is found by looking at<br />

each close <strong>and</strong> finding the one that is furthest from the linear regression line. One limit line is<br />

placed parallel to the linear regression line, intersecting the close that is furthest from the linear<br />

regression line. The other limit line is placed parallel an equal distance to the other side of the<br />

linear regression line.<br />

The formula is:<br />

(14 * Sum( Accum(@,none)* Close(@),14) - Sum(Accum(@,none),14) * Sum(Close(@),14)) /<br />

(14 * Sum(Power(Accum(@,none),2.00000),14) - Power(Sum(Accum(@,none),14),2.00000))<br />

*<br />

Accum(@,none) + (MA(@,Sim,14) - MA(Accum(@,none),Sim,14)<br />

*<br />

(14 * Sum( Accum(@,none)* Close(@),14) - Sum(Accum(@,none),14) * Sum(Close(@),14)) /<br />

(14 * Sum(Power(Accum(@,none),2.00000),14) - Power(Sum(Accum(@,none),14),2.00000)))<br />

Note: If your first point is in the past <strong>and</strong> your second point is in the future (beyond the<br />

current bar), the Linear Regression tool will continue recalculating <strong>and</strong> redrawing the regression<br />

lines, including the new bar data, as it <strong>com</strong>es in. Additionally, if your first point is in the future<br />

<strong>and</strong> your second point is in the past, LinR will continue including the new data as it <strong>com</strong>es in,<br />

until the time of the first point is reached, when no new data will be included.<br />

Depending on where your mouse is in relation to the bar <strong>and</strong> the linear regression line, different<br />

values will be displayed in the mouse text box.<br />

Pointer is on the linear regression line, but not near a bar, mouse text displays:<br />

P = Price represented by pointer position<br />

LR:DN = Value of the bottom linear regression envelope line.<br />

LR:LR = Value of the linear regression line.<br />

LR:UP = Value of the top regression envelope line.<br />

S = Slope of the line in price per day.<br />

R2 = The square of the error.<br />

<strong>Charting</strong> <strong>and</strong> <strong>Studies</strong> <strong>User</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!