Announcement

Collapse
No announcement yet.

Can We Make A Linear Regression Slope Indicator Using Jma?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can We Make A Linear Regression Slope Indicator Using Jma?

    The LRS has been around for a number of years but is not widely used and this is what makes it so powerful.

    Most of us are familiar with the standard indicators like RSI or MACD etc. that many people use. We often wonder why it looks like we are “buying the tops” and “selling the bottoms” when we use those indicators. It is really simple. They are considered “lagging indicators” and savvy traders have learned how to exploit them to their advantage. The LRS is considered by some to be a “predictive indicator” meaning that it changes faster than the other indicators in an effort to “predict” the market direction.

    Typically many people use other indicators to indicate overbought and oversold situations and these work sometimes but not reliably enough to be consistently successful. Another way other indicators are used is to identify divergent patterns. Divergence is sometimes difficult to define and frankly in a trending market divergence will kill you. You can get several divergent patterns in a trending market telling you to go countertrend and lose on every single one. What we need is an indicator that we don’t have to try to figure out divergent patterns with and that can notify us of a change in direction much quicker than the old standard indicators. Enter LRS….this is exactly how you use the LRS. You don’t need to look for “divergence” or wait until the move is near the end for it to tell you the move has begun. How many times do your current indicators get you in late on the move and you miss most of it? The most commons answer I hear is “way too often!”.

    There is no doubt that today’s market is different from the market just 5 years ago. For example on the S&P 500, 5 years ago the daily range was double what it is today, which made for easy going. The LRS indicator can bring back the easy going days again.

    Can Jurik research help us? Making this indicator using a JMA would be far superior than anything else on the market.

    Thanks for the help


    A Linear Regression (LR) line is a trend line that is drawn mathematically so that is represents the 'best fit' for the data points it passes through. The formulas use the least squares method to determine the line's placement. This minimizes the distances between the data points and the trend line.

    The algebraic expression for a straight line is: y = b * x + a where b is the slope of the line and a is the y-intercept. The linear regression formula calculate both the b and the a values.


    One technique is to draw equally spaced channel lines at a distance based on Standard Deviation. The Linear Regression draw tool has a multiplier parameter for the Standard Deviation offset. The following example shows red channels lines drawn at 2 times the Standard Deviation. Prices that stay outside of the regression channel indicate a change in trend.



    The next technique that is based on Linear Regression trend lines, is to calculate a Linear Regression line for every set of n bars, and determine the price where the trend line intercepts the last bar in each data set. Thus, one data point is determined for each bar in the chart, and these data points are then connected to create a Linear Regression curve, quite like a moving average. The next chart illustrates several LR lines that each span a set of 5 bars. The price where the LR line intercepts the last bar in each set of 5 bars is marked with a dot. These intercept points are then connected by the red line to form a curve.



    The study is based on the above technique is called Regression Channel. The center line is calculated as illustrated in the prior example. Then bands are added whose distance from the regression center line is based on Standard Deviation.



    The last technique discussed is to plot the Slope of each Linear Regression trend line that is calculated for each set of n bars. In our earlier example with several LR lines, each LR line has a slope. Some have positive slopes wherein the lines are ascending. Some have negative slopes wherein the lines are descending. A change in the slope can be an early indication that the trend is changing direction.



    The Linear Regression Slope (LRS) is a plot of the b values calculated for each set of n bars. In the last 3 illustrations, n had a value of 5. This small set size makes for a choppy channel and a choppy LRS.

  • #2
    I enjoyed your discourse on linear regression lines and slopes. All is true, of course, except the first sentence is true with a twist:

    "The LRS has been around for a number of years but is not widely used and this is what makes it so powerful."

    Use of LRS as a filter, trendline and slope estimator goes back decades. I would venture to say the reason LRS is not used much anymore is that it has been overused in the past, delivered poor results, and was ultimately replaced with better functions.

    Fundamentally, LRS is based on the optimization of squared estimation error. That squaring process makes LRS vulnerable to bias by a single outlier. One bad value can skew the entire line for as long as that outlier is relevant.

    Another problem with LRS is that it is too stiff. It has very poor response to market gaps because it is trying to be a good estimate on ALL the datapoints in its window, when in reality, the most current point is all important.

    There have been attempts to apply higher order polynomials as well, parabolas, cubic splines, etc. All fall in the class known as Savitsky-Golay filters. All use least mean square fitting and are still subject to outlier bias.

    Other filters have been devised since then. Some good, some bad. Some use frequency decomposition (FFT, wavelet). The overshadowing problem is that the nature of noise in market data is not Gaussian distributed and thus renders most filter designs inappropriate.

    Better filter designs begin by dropping the notion of least squares fitting the data and apply nonlinear math. For example, a median filter is very nonlinear and very resistant to outliers. The problem with this class is that, for any size > 3, they have too much lag to be useful.

    What you (and everyone else) seek is the holy grail of filters and every few years a better design is developed. The trend (no pun intended) is to use more nonlinear math. Unfortunately, it is difficult to work with, thereby reducing the number of souls researching the matter.

    - Mark

    Comment

    Working...
    X