• International Apps
    • German
    • Russian
    • Spanish
    • French
    • Portuguese
  • Submit Your App
  • Get NinjaTrader
NinjaTrader Ecosystem
  • NinjaTrader Ecosystem
  • BROKERS
  • MARKET DATA
  • WEBINARS
  • SEARCH
    • Apps & Services
    • User App Share

LSMA SLOPE with an OffSet

The Least Squares Moving Average (LSMA) is a powerful tool for analyzing price trends in financial markets. Unlike traditional moving averages, the LSMA is based on a linear regression line that minimizes the squared differences between observed and predicted values, making it highly responsive to market conditions. In this article, we’ll explore what the LSMA is, how it works, and how an advanced indicator like the LSMA Slope with Offset can enhance trading strategies.
What is the LSMA?
The LSMA is a type of moving average that calculates the best-fit line through a set of data points, using a linear regression model. The line is plotted based on the past price data, and it continuously adjusts itself to the changes in the price movements. This gives traders a more accurate sense of the overall trend direction. The LSMA reacts more quickly to market changes compared to simple or exponential moving averages because it considers the trend over a specified length.

Why is the LSMA Effective?
Trend Detection: By calculating the slope of a regression line, the LSMA identifies whether the market is in an upward or downward trend.
Smoothing: While being sensitive to price changes, it smooths out noise that could generate false signals.
Predictive Power: The LSMA projects the price trend, making it easier for traders to anticipate future movements.

The LSMA Slope Indicator with Offset

The default parameters that indicator comes with, is what I found to work best for scalping on any time frame. This can be customized
The LSMA Slope Indicator works by calculating the slope of the least squares regression line over a specified length of bars. Here’s a breakdown of how it operates:
Sum of Data Points: The indicator sums the prices over the given length and calculates a regression line.
Slope Calculation: The slope of this regression line is calculated using least squares methods.
Offset Adjustment: After calculating the slope, the indicator adjusts it by the defined offset, either moving it forward or backward in time.
Visual Representation: The slope is plotted on the chart, typically in an orange line, providing a clear visual of the trend’s momentum.
Example of Settings
Length: Defines the number of bars used to calculate the LSMA and its slope. A larger length makes the slope smoother but less responsive, while a shorter length reacts quickly but might create more noise.
Offset: Allows the slope to be shifted forward or backward. Traders can adjust this based on their strategy — for example, a forward offset for more proactive trades.

How Traders Can Use the LSMA Slope with Offset

The LSMA Slope Indicator is particularly useful for identifying potential trade opportunities based on momentum shifts. Here are a few ways traders can incorporate it into their strategies:
Trend Confirmation: The LSMA slope can confirm a trend’s strength. For example, a rising slope after a pullback can signal the continuation of an uptrend.
Momentum Shifts: When the slope shifts from positive to negative, it indicates a momentum change, potentially signaling a trend reversal.
Entry/Exit Points: The offset parameter can be used to fine-tune entry and exit points. A forward offset can allow traders to enter earlier in a new trend, while a backward offset can be used to confirm the trend’s direction before committing.
Divergence Analysis: The LSMA slope can be compared with price movements for divergence signals, indicating a potential reversal when price makes new highs or lows but the slope doesn’t follow suit.

Download
Created By PropTraderz
NinjaTrader Version 8
File Size 2.4 KB
Create Date 02/25/2025
# of Downloads 340

Importing to NinjaTrader 8 is Easy!

To import your 3rd party app or add-on to NinjaTrader, simply follow these 3 steps:

  1. Download the app or add-on file to your desktop
  2. From the NinjaTrader Control Center window, select the menu Tools > Import > NinjaScript Add-On…
  3. Select the downloaded file from your desktop

Questions?

Visit the NinjaScript File Sharing discussion in the NinjaTrader user forum to interact with fellow traders and the NinjaTrader support team.

New Additions

One Percent A Week - March 2026 S&C

117 downloads February 12, 2026

Synthetic Oscillator, Hann Filter, High Pass Filter, RMS, SuperSmoother, and Ultimate Smoother - April 2026 S&C

111 downloads February 12, 2026

Copy Trading Pro – Master/Slave Trade Replicator

427 downloads February 12, 2026

RiskReward - multifunction

327 downloads February 12, 2026

CRT - CandleRangeTheory

539 downloads February 2, 2026

Most Popular

UniRenko Universal Renko BarType 8

35518 downloads October 16, 2018

Heiken Ashi 8

31992 downloads October 16, 2018

Vwap

29406 downloads March 21, 2022

Vwap (Volume Weighted Average Price)

25857 downloads October 16, 2018

Simple Trade Copier

23773 downloads December 7, 2023

Interested in becoming a NinjaTrader Ecosystem 3rd party Vendor? Contact Us to learn more.

  • Quick Search
  • NinjaTrader Indicators
  • Automated Strategies
  • Ecosystem Insights
  • Free Trading Webinars
  • Spanish Trading Apps
  • Get NinjaTrader
  • User App Share
  • Trend Line Detection
  • Fibonacci Cluster
  • Renko Bar Type
  • Heiken Ashi
  • Ichimoku Cloud
  • Accumulation Distribution
  • Free Trading Indicators
  • Delta Momentum Indicator
  • Wave Trend Oscillator
  • Open Range Indicator
  • Risk Reward Indicator
  • VPA Indicator
  • Pivot Zones
  • Free Trading Videos
  • Swing Trading Volume Profile
  • Volume Leading Indicator
  • How to Use Volume Profile
  • Combine Order Flow
  • Buy Sell Signals
  • Market Profile

Disclosures | Privacy Policy | GDPR

Copyright © 2026 NinjaTrader, LLC. All Rights Reserved.

Please note that NinjaTrader Ecosystem does not have a Telegram or LinkedIn account

This website is operated by NinjaTrader, LLC (“NT”). NT is affiliated with NinjaTrader Clearing, LLC d/b/a NinjaTrader, Kraken Derivatives US, and Tradovate (“NTC”) through NinjaTrader Group, LLC (“NTG”), collectively “NinjaTrader”. NT owns and supports the proprietary NinjaTrader trading platform as a software development company, while NTC provides brokerage services. View Disclosures.

NTC is registered with the Commodity Futures Trading Commission (“CFTC”) as a futures commission merchant (“FCM”) and is a National Futures Association (“NFA”) Member (NFA ID: 0309379). Questions related to brokerage accounts should be directed to your broker.

Futures, options, foreign currency, digital asset, and event contract trading involves substantial risk and is not suitable for everyone. An investor may lose all or more than the initial investment. Trading should be undertaken only with risk capital—funds that can be lost without jeopardizing one’s financial security or lifestyle—and only by those who can afford such losses. Past performance is not necessarily indicative of future results. Prior to trading digital assets, review the CFTC and NFA advisories for additional information regarding the significant risks involved. View Risk Disclosure Statement.

This website is provided by NinjaTrader on an “as-is” basis for informational purposes only and does not constitute investment advice, a recommendation, or an offer or solicitation to buy, sell, or hold any commodity interest or financial product or engage in any investment strategy. Content may include statements or opinions of NTG and its affiliates or third-party information; no representation or warranty, express or implied, is made as to the accuracy or completeness of the information herein. NinjaTrader disclaims all liability arising from use of or reliance on such information.

Any testimonials and endorsements herein reflect the opinions of either current or former NinjaTrader customers or third parties and may not be representative of the experiences of other customers. Individual results may vary. Such testimonials and endorsements may be solicited and/or compensated.

NFA Rule 2-29(c): Hypothetical performance results have many inherent limitations, some of which are described below. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown. In fact, there are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program. One of the limitations of hypothetical performance results is that they are generally prepared with the benefit of hindsight. In addition, hypothetical trading does not involve financial risk, and no hypothetical trading record can completely account for the impact of financial risk in actual trading. For example, the ability to withstand losses or to adhere to a particular trading program in spite of trading losses are material points which can also adversely affect actual trading results. There are numerous other factors related to the markets in general or to the implementation of any specific trading program which cannot be fully accounted for in the preparation of hypothetical performance results and all of which can adversely affect actual trading results.