Sequentially Filtered Moving Average
Feb 15, 2020

The Sequentially Filtered Moving Average indicator provides a noise-reduced trend-following tool that updates only when price movements exhibit consistent directional sequences, making it an effective alternative for slow moving average components in crossover strategies.
Usage
The Usage section describes how the script can be used to identify trends and reduce market noise. The indicator is primarily designed to act as a robust filter for price action, remaining flat during periods of consolidation and updating only when a clear directional trend is established.
- Trend Identification: The SFMA changes color based on its direction. A green line indicates an upward trend, while a red line indicates a downward trend. When the market moves sideways, the indicator remains horizontal, helping traders avoid "choppy" price action.
- Crossover Systems: This indicator can be used as the "slow" moving average in a crossover system. Because it filters out short-term volatility, it typically produces fewer false signals (whipsaws) compared to a standard Simple Moving Average (SMA). For example, pairing a fast 50-period SMA with a 200-period SFMA can provide more stable entries and exits.
- Support and Resistance: Due to its "step-like" nature during ranging markets, the flat levels of the SFMA can serve as dynamic areas of support or resistance.
Details
The Sequentially Filtered Moving Average (SFMA) is built upon the concept of a sequential filter. Unlike traditional filters that focus on the amplitude of price changes, the SFMA focuses on the duration of directional consistency.
The script first calculates a Simple Moving Average (SMA) of the selected source. It then evaluates the direction of this SMA over a specific number of bars defined by the Length parameter. The filter only updates the output value to the current SMA value if the SMA has moved in the same direction for a consecutive number of bars equal to the length. If this condition is not met, the indicator maintains its previous value.
This mechanism allows the SFMA to ignore large, volatile price spikes that do not lead to sustained trends, though it may result in some lag during sudden market reversals or gaps.
Settings
- Length: This input controls both the period of the underlying Simple Moving Average and the required length of the directional sequence. Larger values result in a smoother, less reactive line that is better for long-term trend following.
- Source: Determines the price data used for the calculation (e.g., Close, Open, High, Low).
FAQ
How does the SFMA differ from a standard Simple Moving Average? A standard SMA updates every bar based on price changes, which can lead to "noise" in choppy markets. The SFMA only updates when there is a consistent directional sequence, causing it to remain flat and filter out insignificant fluctuations.
Why does the indicator sometimes lag behind price? The lag is a result of the sequential filtering process. The indicator requires a specific number of consecutive directional moves before it updates, which inherently introduces a delay but ensures the trend is more established.
How can I access the Sequentially Filtered Moving Average? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Unlock Unlimited Access to the LuxAlgo Library
Upgrade your plan to get all indicators, strategies, charts, and full access to Quant, our AI agent.
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.

