Professional Documents
Culture Documents
TECHNICAL ANALYSIS
LINEAR REGRESSION INDICATORS
Submitted to Dr. Akshay Damani
Date: 21/01/2021
Types of indicators: 3
Limitations of LR 8
Conclusion 9
References 9
Page | 1
About Linear Regression
The history of linear regression can be traced back to early 19th century when the method of
least squares was first published by Adrien-Marie Legendre.
A linear regression statistical model aims to establish a relationship between one or more
variables. These explanatory variables are also known as dependant and independent
variables. The analysis has extensive applications in economics, pricing, forecasting, machine
learning and even artificial intelligence. The use of simple linear regression in the finance
industry started from the most famous and widely known Capital Asset Pricing Model.
Page | 2
This analysis shows the trader when a security is bought a lot and thus, the price deviates
above the mean or the security is sold a lot and thus, deviates to the mean or falls below it
mean. The three lines viz., Linear Regression Central Line, Linear Regression Lower Line
and Linear Regression Upper Lines creates channels and shows traders the prevailing price
trend. Using a variable or moving regression path, channels can be created by setting the
standard deviation at 1 (i.e., 68%) or 2 (i.e., 95%).
The closing price data is smoothened out with the calculation of slope and it works as an
oscillator. Fluctuations of the oscillator above or below ‘0’ can be used to make trade
decisions.
The benefit of using the linear regression indicator over a simple moving average is that it has
less delay making it respond quickly when the trend changes its direction.
Types of indicators
1. Linear Regression Central, Upper and Lower Lines
Linear Regression Central Line: A Linear Regression Line is a straight line that
best fits the prices between a starting price point and an ending price point. A "best
fit" means that a line is constructed where there is the least amount of space between
the price points and the actual Linear Regression Line. The Linear Regression Line is
mainly used to determine trend direction. When prices deviate above or below, traders
may expect prices to go back towards the Linear Regression Line. As a consequence,
when prices are below the Linear Regression Line, this could be viewed by some
traders as a good time to buy, and when prices are above the Linear Regression Line,
a trader
might sell.
Upper Channel Line: A line that runs parallel to the Linear Regression Line and is
usually one to two standard deviations above the Linear Regression Line.
Lower Channel Line: This line runs parallel to the Linear Regression Line and is
usually one to two standard deviations below the Linear Regression Line.
The width of the channel is based on the high or low that is the furthest from the linear
regression. There are two types of linear regression channel, depending on the direction of the
trend – the bullish and the bearish linear regression channels. These two types of regression
channels are defined based on the linear regression slope. Technical and quantitative analysts
have applied statistical principles to the financial market.- The bullish linear regression
channel refers to bullish trends. In this case, the price is increasing and the slope of the linear
regression is upwards. The bearish linear regression channel is opposite to the bullish
regression channel and it refers to bearish trends. For the bearish scenario, the price is
decreasing and the slope of the regression channel is downward.
The upper and lower channel lines contain between themselves either 68% of all prices (if 1
standard deviation is used) or 95% of all prices (if 2 standard deviations are used). When
prices break outside of the channels, either: Buy or sell opportunities are present. Or the prior
Page | 3
trend could be ending. The following steps are to be followed to graphically plot the
regression lines.
Page | 4
The property of mean reversion is of significant importance while making trade decisions
using the three linear regression lines. Over the last 10 months, Titan Company’s stock price
has more or less, stayed within the range of the lower and upper lines. When the stock price
attempts to breakout the 1-sigma upper deviation line from below, the price soon reverts back
to the rolling mean value. Similarly, when the price falls below the lower line, traders buy the
stock, thus bringing the stock’s price back to the mean value.
A more advanced version of the earlier three regression lines is used by many traders in order
to identify entry and exit points, to make profitable trades. The below graph is a 50-day linear
regression indicator of Titan Company Ltd. adjusted for 1-sigma and 1.5-sigma standard
deviation events.
The 1.5-sigma lines act as upper and lower regression lines and 1-sigma lines act as entry and
lines. When the closing price rises to the two upper lines, the trader can mark them to be
profitable exits. On the other hand, the when the closing price cuts the entry line from below,
the trader can buy the security and place a stop loss on the lower regression line.
The value of slope is calculated using the =LINEST function on excel as explained earlier.
The oscillator is plotted using a separate 2D line graph and placed below the graph that is
tracking the closing price.
The below graph is a 14-day momentum oscillator calculated using the slope of closing
prices.
Page | 5
Figure 3: Linear Regression Slope Indicator
A 14-day moving slope is seen to oscillate above and below the central line very often, thus
giving traders opportunities to enter and exit the trade. When the slope line cuts the central
line from below, a short-term uptrend is anticipated, and creating a long position is the aim.
Similarly, when the slope line cuts the central line from above, a downward trend is in place.
3. Linear Regression Angle Indicator
Linear Regression Angle is a directional movement indicator which defines a trend at the
moment of its birth, and additionally defines trend weakening. The indicator calculates the
angle of the linear regression channel and displays it in a separate window in the form of
histogram. The signal line is a simple average of the angle.
The angle is the difference between the right and left edges of regression (in points), divided
by its period.
The angle value above 0 indicates an uptrend. The higher the value, the stronger the trend. A
value below 0 indicates a downtrend. The lower the value, the stronger the downtrend.
When a time-frame is decided and the slope is calculated using the aforementioned excel
function, the value of the regression angle can be calculated using the following excel
function:
=DEGREES(ATAN(number))
The value of slope for the day’s closing price is put in the ATAN function and the result is
converted into degrees using the DEGREES function.
A 2D stacked line chart is plotted with dates on the x-axis and price on the y-axis. The value
of the angle line (orange) in Figure 4 is plotted along the closing price and the deviation is
represented with a stacked display.
The below graph is a 14-day regression angle indicator calculated using the slope of closing
price of Titan Company Ltd.
Page | 6
Figure 4: Linear Regression Angle Indicator
The value of the angle ranges from -88o to +86o and the deviation is represented by the
movement of the angle line below or above the closing price line respectively. A fall in the
closing price of Titan Company Ltd. is caught by the negative slope, thus resulting in a
negative regression angle and ultimately giving the trader a hint to short sell.
These indicators can be used independently or can be combined to give a more accurate
prediction. The accuracy of an indicator can be confirmed and decision can be taken to add or
remove indicators that enhance each other and give an accurate prediction for the security in
question.
The regression slope and angle indicators can be plotted on two separate graphs and placed
one below the other.
Page | 7
Limitations of Linear Regression Indicators
The future is shown as a linear increase which is not true as if you observe the actual
values you see a jump up and a fall down in the prices. There is a lot of variability in
the actual data but a standard increase in the forecasted values.
The line goes only one way which means if the past has been of an average increase
over a period of time then the future will also show the average increase over the next
period. In reality, there is always a danger of trend reversal which the linear forecast
can never reveal.
This indicator alone isn’t sufficient to deduce a price movement for a stock and is
generally used only as a confirmation indicator that is used to supplement other
indicators.
Stock Analysis
The primary form of Linear Regression Channel analysis involves watching for price
interactions with the three lines that compose the regression indicator. Each time that the
price interacts with the upper or the lower line, we should expect to see a potential turning
point on the chart. For swing traders, this means that you want to enter after a retracement in
the direction of the trend, and exit when price approaches the opposite end of the channel.
1. As seen in the case of Info Edge, we can see that the stock price movements have been
following a bearish trend with signs of reversal in the upcoming future. It is further
rectified by the latest price movement shown on January 21, 2021 where the stock
deviated from its normal bearish flow and formed a bull candle. This shows the sign of a
trend reversal and it would be apt to take a long position in this stock with the central line
and the upper line acting as target levels for the stock.
2. In case of Nestle, multiple levels have been achieved to give further clarification on the
price movements of the stock. We can see that the linear regression pattern formed on 23
September 2020 perfectly followed the price movements predicted by the tool. Also, for
the current state the apt strategy would be based on the next day’s candle. If the trend
reversal and reaches the entry point line, a long position would be suitable according to
the target levels. An aggressive trader may choose target levels different as seen in the
graph and a passive trader may set the central line as the first target level and the target 1
as the second target level.
3. For ITC, a shorter period for linear regression movements have been studied to measure
the volatility in the short term. As seen ITC had just recently breached the Upper Linear
regression line and has started correcting itself towards the mean as seen in the latest
price movements. So, a short position would be recommended as the analysis show a
possible downtrend in the near future
4. For ICICI, the linear regression slope indicates a bearish trend and the investor can wait
for the stock to go below the 0-slope level and thus on that basis can go on to short the
stock. Though if the price movements are bullish in the next 1-2 days a long position
would be suggested.
Page | 8
Conclusion
As seen, Linear regression helps us in finding out the price movements of stock and
identifying the trend that a stock may end up following. A linear regression line should not
be used a system itself. Rather it should be used in the context of a larger trading
system – mechanical or otherwise – that uses other technical indicators, price,
candlestick patterns, support and resistance levels, and/or fundamental analysis to
improve the accuracy of trading decisions. But it can be more useful than normal moving
average as a fit regression line would be better in indicating price movements when compared
to linear moving average which justifies the trend on the basis of the average of the closing
price of stocks. Thus, it is more responsive than simple moving average and a trader can
incubate this in his/her strategy replacing SMA by making necessary adjustments. Another
advantage of using linear regression is that it considers the deviations of the stock movements
and thus can be easily adjusted for volatility with the help of offset option. Thus, linear
regression can be used to create a solid strategy when used with proper mix of other
indicators. The beauty of linear regression is that the security's price and time period
determine the system parameters. Use these tools and the rules defined within this article on
various securities and time frames and you will be surprised by its universal nature.
References
E. Norris (2020), “The Linear Regression of Time and Price”, Investopedia
I. Mukherjee (2018), “Linear Regression Slope Indicator Strategy”, Stock Maniacs
Allwyn (2020), “Linear Regression to Forecast Stock Prices”, Analytics Vidhya
X Study Documentation, “Linear Regression Angle”, Trading Technologies
X Study Documentation, “Linear Regression Slope”, Trading Technologies
Page | 9