STD-Stepped, Variety N-Tuple Moving Averages

Sep 5, 2022

Static chart image
Signals
Moving Averages
Volatility

The STD-Stepped, Variety N-Tuple Moving Averages indicator provides a standard deviation-filtered N-tuple moving average that allows users to create deeply nested smoothing structures from double up to 15-tuple layers. This tool aims to reduce lag while maintaining smoothness by applying a factorial-based weighting system to multiple iterations of a base moving average, further refined by a standard deviation stepping filter.

Usage

The Usage section describes how the script can be used to create custom smoothing profiles. By selecting a base moving average type (such as EMA) and increasing the "Depth," users can create advanced versions of standard indicators; for example, an EMA with a depth of 2 is equivalent to a DEMA, while a depth of 3 results in a TEMA.

The indicator features a "Standard Deviation Stepping" filter, which allows the moving average to remain flat (stepped) until the price or the average itself moves beyond a specific standard deviation threshold. This is particularly useful for filtering out market noise during consolidation phases. Users can choose to apply the filter to the price, the N-tuple moving average (NTMA), or both.

Details

The script operates through a three-step mathematical process:

  1. Factorial Calculation: It runs a factorial calculation on the user-defined depth value.
  2. Weighting: It calculates the weights of the nested moving averages using the formula: factorial(depth) / (factorial(depth - k) * factorial(k)), where k represents the weight position.
  3. Coefficient Application: Each layer of the moving average is calculated sequentially (e.g., EMA1, then EMA2 of EMA1, etc.), and the calculated coefficients are applied to produce the final N-tuple result.

This implementation includes 5 base moving average types (EMA, WMA, SMA, RMA, and T3) and supports extended source types, including Heiken-Ashi and better-smoothed variants.

Settings

  • Heiken-Ashi Better Smoothing: Selects the smoothing algorithm for source calculations (AMA, T3, or Kaufman).
  • Source: Choose the price data input, including standard options and various Heiken-Ashi derived sources.
  • Period: Sets the lookback period for the base moving average calculation.
  • Depth: Determines the number of nested layers (1-15). Higher values increase the complexity of the N-tuple calculation.
  • Variety Moving Average Type: The base algorithm used for nesting (EMA, WMA, SMA, RMA, or T3).
  • T3 Settings: Adjusts the "Hotness" and calculation type (New vs. Original) specifically for the T3 moving average.
  • Filter Options: Determines if the standard deviation step filter is applied to "Price," "NTMA," "Both," or "None."
  • Filter Deviations: The multiplier for the standard deviation filter to determine the stepping threshold.
  • Filter Period: The lookback window used to calculate the standard deviation for the filter.
  • UI Options: Toggles for bar coloring and visual buy/sell signals on the chart.
  • Moving Average Inputs: Specific parameters for Kaufman's Adaptive MA (KAMA) and Adaptive Moving Average (AMA).

FAQ

How do I interpret the "Depth" setting? The Depth setting determines how many times the moving average is nested. A depth of 1 is a standard MA, while higher depths create more responsive, zero-lag style averages like DEMA (Depth 2) or TEMA (Depth 3).

What does the "Stepping" do? The stepping mechanism acts as a volatility filter. If the price movement is within the "Filter Deviations" range, the indicator line remains horizontal, helping traders avoid "whipsaws" in sideways markets.

How can I access this indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free access on the following platforms
tradingviewSymbolTradingView
ninjatraderNinjaTrader
metatrader4MetaTrader 4/5
thinkorswimThinkorswim

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.