Mastering the Least Square Moving Average

The Least Square Moving Average (LSMA) is a technical analysis tool that smooths out price data over a specified period. It fits a straight line to the price data, minimizing the sum of the squares of the deviations between the data and the line. By reducing the noise in the data, LSMA can help traders identify trends and potential trading opportunities.

least squares moving average calculation

Definition Of LSMA

Imagine you are a trader who has been eyeing the stock performance of Netflix. for some time now. You have noticed that the price movement seems to be taking a bearish trend, and you want to take advantage of it by selling your stocks before they lose more value.

But how do you know when is the best time to sell?

This is where LSMA comes in handy.

least squared moving average

LSMA stands for Least Square Moving Average; an average indicator used in technical analysis to identify trends and signals within financial markets. As a regression-based trend indicator, LSMA smooths out market noise over a specified period and provides traders with potential buy or sell signals based on its calculated values.

In other words, it helps traders and investors make better decisions about their trades.

To understand better how LSMA works, let’s focus on its use as a trend indicator during a bearish phase.

A bearish trend occurs when prices fall continuously due to increased selling pressure. During such periods, traders can use LSMA to spot potential sell signals – points at which the price may continue falling – so that they can exit their positions before losing more money in the trade.

How LSMA Is Calculated

To fully understand how LSMA works, it doesn’t hurt to know the calculation process. First, we use the least squares method to determine the trend direction of a market over a given period of time. This involves finding the line of best fit for the closing prices in that time frame.

Once you have the slope and intercept, you can use them to calculate the LSMA for each data point in the period. It is calculated by multiplying the current period’s data point by the slope and adding the intercept.

This process is repeated for each data point in the period, resulting in a smooth line that represents the LSMA for that period.

If you want to geek out over the actual calculation, here it is:

LSMA = (N * Σ(X*Y) – Σ(X) * Σ(Y)) / (N * Σ(X^2) – (Σ(X))^2)


  • LSMA: Least Square Moving Average
  • N: Number of data points in the period
  • Σ: Summation of values
  • X: Index values of data points in the period (1, 2, 3,…, N)
  • Y: Price values of data points in the period

The formula calculates the slope and intercept of the linear regression line that best fits the price data for the given period. The LSMA is then obtained by multiplying each data point’s index value by the slope and adding the intercept. The resulting values create a smoothed line that represents the LSMA for that period.

Key Advantage

One key advantage is its ability to filter out short-term fluctuations in price movements. By smoothing out market noise, this technical indicator provides more reliable signals for traders looking to enter or exit positions.

However, like any trading tool, it’s important not to rely solely on LSMA for trade signals and instead incorporate other indicators into your analysis.

When using the LSMA, traders can look for crossovers with other technical indicators or support/resistance levels as confirmation of their trades. It’s important to note that this tool is not foolproof and may generate false signals at times.

Differences Between LSMA And SMA

The differences between the least square moving average (LSMA) and simple moving average (SMA) can be compared to the contrast between an artist’s brushstrokes and a child’s crayon scribbles.


While both techniques seek to capture trends in data, LSMA does so with greater accuracy than SMA by taking into account more variables.

One of the primary things that distinguish LSMA from SMA is their calculation methods. The LSMA uses squares regression analysis to determine its values, while the SMA takes the average over a set time period.

For instance, given LSMA’s ability to filter out noise and precisely identify turning points in price movements, it is often used as a trend-following indicator.

SMA may provide less accurate signals due to its simplicity and lack of sensitivity to market changes. As such, understanding the differences between these two techniques is crucial for any trader seeking to maximize returns on investment.

LSMA As A Trend Following Indicator

LSMA is commonly used as a trend following indicator for traders who look to identify bullish trends as well as bearish trends. This is because it smooths out prices and reduces false signals of trend reversal.


For instance, when prices cross above LSMA from below, this could signal a potential uptrend or bullish momentum. On the other hand, if prices cross below LSMA from above, this may indicate a downtrend or bearish sentiment.

Another advantage of using LSMA is its ability to detect average crossovers more accurately than other indicators such as simple moving averages (SMA). In fact, some day traders prefer using LSMA over SMA as their main technical analysis tool due to its precision, sensitivity to change and reliability.

You can customize your settings according to your preferred time frame and trading style – whether short-term or long-term strategies.

Pros And Cons Of LSMA

When it comes to using the least square moving average (LSMA) as a tool for technical analysis, there are pros and cons that must be considered. As with any trading strategy or indicator, making the decision to use LSMA must be well thought out:

Pros Cons
The LSMA is effective in smoothing out data points that may contain noise or volatility spikes. Using default settings on an LSMA can lead to false signals due to its reliance on past data.
It allows traders to easily identify trends by reducing lagging signals. Due to it being a lagging indicator, it may not provide timely signals during rapid price changes.
By adjusting the settings, traders can customize their LSMA indicators to fit specific market conditions. Traders must also consider how dependent variables such as volume affect the accuracy of their LSMA calculations.

Making the decision whether or not to rely on LSMA as a part of your trading strategy ultimately depends on trader preferences and goals. There is no one-size-fits-all solution when it comes to technical analysis tools.  There are no default indicators and you must test out anything you want to use in a strategy.

 How To Trade Using LSMA

Traders can utilize the least square moving average (LSMA) to identify trading signals that can form the basis for a robust trading strategy.

The indicator functions as a trend indicator with very little lag, a reversal indicator and even a buy and sell signal indicator.

The LSMA is useful in identifying buy signals/sell signals during an uptrend/downtrend. For example, if there is a recovery in prices after a downtrend, traders may see a buy signal from price and the LSMA indicator.

To maximize profits utilizing the LSMA approach, traders should develop their own unique trading strategies based on these signals.

Here are some trend signals to look out for:

  1. A bullish crossover where the current price crosses above its LSMA
  2. An uptrend indicated by higher highs and higher lows
  3. A bearish crossover where the current price falls below its LSMA

Moving Average Crossover

A popular method of retail traders is to look for the crossing of a short term average over a long term average.  The cross shows that we have short-term uptrend momentum and a definite buy trade should be considered.


This is a 10 period and a 50 period LSMA.  We have a strong crossover signal on the LEFT and the sharp angle of the 10 period shows that.  Traders can take the cross as a definite signal or wait until a candlestick puts in a lower low as seen by the arrow to avoid a false buy signal on the cross.

This arrow shows a short term pullback and traders can then buy stop the high.

Price LSMA Cross

This strategy was highlighted in an article about trading the daily time frame.  Read that article but in short, we are looking for 2 candlestick lows completely above the LSMA (example is 25 period).

lsma price cross

The arrows show the second candlestick that plots above the average.  To ensure a definite buy signal, a trader would calculate an ATR buffer above the highest of the two candlesticks for the trade entry.  This is covered in the article cited above.

Primary Indicators Setup

You would use the LSMA for trend direction and another indicator of your choosing.  Consider using an oscillator such as the 3 10 Oscillator.


Price breaks a trendline with a higher high giving us an uptrend signal.  LSMA is also broken by price and trending upwards.  Traders would use their own entry tactics to enter.  At the top of the chart, we have the 3 10 Oscillator putting in a lower high while price puts in higher high.  This would be sign to consider exiting the trade.

Frequently Asked Questions

How does the LSMA calculation process work?

The LSMA calculation process involves using the least squares method to determine the trend direction of a market over a given period of time. This is done by finding the line of best fit for the closing prices in that time frame, which is used to calculate the LSMA for each data point. By smoothing out market noise, LSMA can help traders identify trends and potential trading opportunities.

What are the key features of the LSMA indicator?

The LSMA indicator is a powerful tool for traders seeking to identify trends in price data. Key features of the LSMA include its ability to filter out short-term market noise, its accuracy in predicting market trends, and its ability to provide reliable trade signals.

What are the pros and cons of using EMA versus SMA?

EMA and SMA are two commonly used moving averages in trading. While EMAs tend to be more responsive to recent price changes, making them suitable for short-term analysis, they can also generate more false signals. SMAs, on the other hand, are slower to respond to price changes and are better suited for long-term analysis, but may be less accurate in identifying trend changes.

How does the moving average work in predicting future price trends?

They work by calculating the average price of an asset over a certain period of time, with the most recent prices given greater weight than older prices (EMA). By reducing the noise in the data, moving averages can help traders identify trends and potential trading opportunities, which can be used to predict future price trends.  Think:  an object in motion tends to stay in motion.


In conclusion, mastering the least square moving average can be a game-changer for your day trading strategies. By accurately predicting asset movements, you can make potentially better decisions and increase your chances of success in the market. Take the time to learn this powerful tool and see if you can improve your trading.

Author: CoachShane
Shane his trading journey in 2005, became a Netpicks customer in 2008 needing structure in his trading approach. His focus is on the technical side of trading filtering in a macro overview and credits a handful of traders that have heavily influenced his relaxed approach to trading. Shane started day trading Forex but has since transitioned to a swing/position focus in most markets including commodities and futures. This has allowed less time in front of the computer without an adverse affect on returns.


Comments are closed.