Please note links are direct so use back arrow to return to blog or
right click>Open in New Window.
Some time ago I go interested in Linear Regression Slope and it has
been on my things to do list to do more work with it. My initial
interest was spurred by this well done article available from
Stocks and Commodities Magazine (Dec 2007 p.72):
Now it’s been a while but I believe there is a problem with the
Ninja code as presented by Ninja. There is extensive discussion
about this on the Ninja board but the main problem is as per
“The slope is a
measure of the steepness of a line. This is the calculation of rise
over run and not to be confused with linear regression
slope.”
I set up the Ninja code to compare with the specific charts in
Star’s article and they were different. Fortunately however someone
did create another LRS for Ninja and it can be downloaded
here:
LinRegSlopeSFX - Linear regression slope super fast calc with
option for exponential weighting
This indicator matched Stars’ charts. The chart below is at least a
close match to the one Matt posted.
RSquared indicates the strength of trend. Star likes to see it
crossing up over the .2 level as she goes into a trade indicating
trend has been consolidating but is now increasing. LSR is used for
direction.
Related is the linear regression indicator in the main pane which
is actually the
endpoint
of a type of trendline. It computes price direction based on a the
least-squares fit, which plots a straight line though the price
datapoints rather than averaging the datapoints. As the direction
of the market changes, the direction of the endpoint of the
straight trendline changes sooner than would a moving average of
the price points so it is like a cross between a moving average and
a trendline. Note how much more responsive the 50 period line
(black) is vs the 50 EMA (blue). I just put those for example but
actually one could have done worse than follow the cross signals
for the S&P! In Strategy Desk this indicator is called Time
Series Forecast.
Ipwise I noticed on the screenshot of the chart you posted
before that you are using the indicator with a time period of 17. I
believe that Matt has a setting of 23 which if you take a look, is
much less whippy. FWIW
Title: Linear Regression Slope, RSquared
Posted by bkout3 on 5th of Nov 2009 at 11:46 am
Please note links are direct so use back arrow to return to blog or right click>Open in New Window.
Some time ago I go interested in Linear Regression Slope and it has been on my things to do list to do more work with it. My initial interest was spurred by this well done article available from Stocks and Commodities Magazine (Dec 2007 p.72):
http://store.traders.com/stcov257copr.html
Next link takes you to code for various platforms (including TradeStation, Ninja and Ameritrade) for the indicators that are discussed.
http://www.traders.com/Documentation/Feedbk_docs/2007/12/TradersTips/TradersTips.html
Now it’s been a while but I believe there is a problem with the Ninja code as presented by Ninja. There is extensive discussion about this on the Ninja board but the main problem is as per
http://www.ninjatrader-support.com/HelpGuideV6/helpguide.html?Slope
“The slope is a measure of the steepness of a line. This is the calculation of rise over run and not to be confused with linear regression slope.”
I set up the Ninja code to compare with the specific charts in Star’s article and they were different. Fortunately however someone did create another LRS for Ninja and it can be downloaded here:
http://www.ninjatrader-support2.com/vb/local_links.php?catid=1&sort=N&pp=15&page=8
look for title:
LinRegSlopeSFX - Linear regression slope super fast calc with option for exponential weighting
This indicator matched Stars’ charts. The chart below is at least a close match to the one Matt posted.
RSquared indicates the strength of trend. Star likes to see it crossing up over the .2 level as she goes into a trade indicating trend has been consolidating but is now increasing. LSR is used for direction.
Related is the linear regression indicator in the main pane which is actually the endpoint of a type of trendline. It computes price direction based on a the least-squares fit, which plots a straight line though the price datapoints rather than averaging the datapoints. As the direction of the market changes, the direction of the endpoint of the straight trendline changes sooner than would a moving average of the price points so it is like a cross between a moving average and a trendline. Note how much more responsive the 50 period line (black) is vs the 50 EMA (blue). I just put those for example but actually one could have done worse than follow the cross signals for the S&P! In Strategy Desk this indicator is called Time Series Forecast.
Here's the equivalent TS setup.
Posted by matt on 5th of Nov 2009 at 02:03 pm
Here's the equivalent TS setup. You have to use the 'Linear Regression Curve' and the 50 EMA
WOW!
Posted by lpwise on 5th of Nov 2009 at 11:50 am
Brian,
Thanks very much for sharing your research.
I think this interesting indicator warrants investigation, so that really helps!
Lp
ditto! Thanks a lot, Brian!
Posted by junkie on 5th of Nov 2009 at 01:53 pm
ditto! Thanks a lot, Brian!
Ipwise I noticed on the
Posted by Vida on 5th of Nov 2009 at 01:10 pm
Ipwise I noticed on the screenshot of the chart you posted before that you are using the indicator with a time period of 17. I believe that Matt has a setting of 23 which if you take a look, is much less whippy. FWIW
re: thanks Vida
Posted by lpwise on 5th of Nov 2009 at 04:23 pm
Thanks vida. I think matt told me originally between 17-23 so I've been experimenting.