Tom's Moving Average & Lagging Span
Jul 25, 2018

The Tom's Moving Average & Lagging Span indicator provides a comprehensive multi-period trend analysis toolkit by combining five Simple Moving Averages (SMA) with a displaced Ichimoku Lagging Span to identify momentum and historical price comparisons.
Usage
The Usage of this indicator focuses on identifying trend direction, potential reversals, and dynamic support and resistance levels across various timeframes.
- Trend Identification: By plotting five distinct SMAs—ranging from very short-term (5 periods) to very long-term (200 periods)—traders can visualize the strength of a trend. When the shorter SMAs are positioned above the longer SMAs, it typically indicates a bullish trend, while the reverse indicates a bearish trend.
- Lagging Span Analysis: The Lagging Span (Chikou Span) plots the current closing price shifted back by a specific number of periods (default is 26). This allows traders to compare current price action to historical price levels to determine if the market is in a breakout or range-bound state.
- Price Crossovers: The indicator is configured to monitor price interactions with the "Short SMA" (defaulting to 20 periods). Crossovers above or below this specific moving average are often used as signals for short-term momentum shifts.
Details
The indicator is constructed using standard Simple Moving Average calculations and price displacement logic. It was originally designed by @matsu_bitmex and refactored for modern script standards.
- Moving Averages: The script calculates five separate SMAs using a user-defined source (typically the closing price). These lengths are optimized for common technical analysis benchmarks: 5, 20, 40, 100, and 200.
- Displacement: The Lagging Span component utilizes a negative offset. This visualizes the current price 26 bars in the past, a core component of the Ichimoku Kinko Hyo system, helping to identify where current price sits relative to past volatility.
- Alert System: The script includes optimized alert conditions for price crossing the 20-period SMA, facilitating automated monitoring of key trend pivots.
Settings
- SMA very short length: Sets the lookback period for the fastest moving average (Default: 5).
- SMA short length: Sets the lookback period for the short-term moving average and alert trigger (Default: 20).
- SMA middle length: Sets the lookback period for the medium-term moving average (Default: 40).
- SMA long length: Sets the lookback period for the long-term moving average (Default: 100).
- SMA very long length: Sets the lookback period for the macro trend moving average (Default: 200).
- SMA source: Determines the price input used for all SMA calculations (Default: Close).
- Lagging Span Length: Determines the number of bars the price is shifted backward on the chart (Default: 26).
FAQ
What is the benefit of using five different moving averages? Using multiple SMAs allows traders to see the "tide" of the market across different horizons simultaneously, helping to distinguish between a minor pullback and a major trend change.
Can the Lagging Span be used for trade signals? Yes, in Ichimoku theory, when the Lagging Span is above the price candles from 26 periods ago, it is considered bullish; when below, it is considered bearish.
How do I access Tom's Moving Average & Lagging Span? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

