Variety N-Tuple Moving Averages w/ Variety Stepping

Sep 11, 2022

Static chart image
Signals
Channels
Moving Averages
Volatility

The Variety N-Tuple Moving Averages w/ Variety Stepping indicator calculates highly customizable moving averages ranging from 1 to 30 tuples while offering advanced volatility-based stepping and filtering. It provides a streamlined, computationally efficient method to generate complex moving average types like Double-EMA, Triple-EMA, or higher-order N-tuple variations combined with multiple band and signal options.

Usage

The Usage section describes how the script can be used, examples should be provided in this section. This section also focuses on how main settings affect the indicator interpretation and output.

The indicator is primarily used to identify trend direction and momentum through high-order smoothing. Users can select the "Depth" to determine the order of the moving average (e.g., a depth of 3 creates a Triple Moving Average).

The "Stepping" feature filters out market noise. If the price or moving average does not move beyond a specific threshold (defined by the chosen deviation type and multiplier), the value remains unchanged from the previous bar, resulting in a "staircase" effect during consolidation.

Examples of usage:

  • Trend Identification: A green line indicates an uptrend, while a red line indicates a downtrend.
  • Volatility Filtering: Using "Adaptive Deviation" stepping can help traders avoid whipsaws in choppy markets by requiring a specific volatility-adjusted move before the indicator updates.
  • Mean Reversion: Utilizing the built-in bands (e.g., ATR or Standard Deviation) helps identify potential overextended price levels relative to the N-tuple average.

Details

The indicator utilizes a streamlined looping solution and arrays to calculate weighted nested moving averages without excessive memory consumption. The process follows three main steps:

  1. Factorial Calculation: The script runs a factorial calculation based on the user-defined depth.
  2. Weight Assignment: It calculates the weights of nested moving averages using the formula factorial(depth) / (factorial(depth - k) * factorial(k)).
  3. Coefficient Application: These coefficients are applied to the sequence of MAs. For example, a 5-depth EMA (Quintuple EMA) calculation follows the structure: 5 * ema1 - 10 * ema2 + 10 * ema3 - 5 * ema4 + ema5.

The stepping logic employs various statistical measures (ATR, Standard Deviation, Adaptive Deviation, etc.) to evaluate if current movement is significant enough to warrant an update in the indicator's output value.

Settings

Basic Settings

  • Period: The lookback period used for the base moving average calculation.
  • Depth: Determines the tuple order (1-50). Higher values increase smoothing and lag.
  • Moving Average Type: Choose between Exponential Moving Average (EMA) or Running Moving Average (RMA).

Filter Settings

  • Price Filter Type: Selects the statistical method for filtering the input source (ATR, Standard Deviation, etc.).
  • Moving Average Filter Type: Selects the statistical method for filtering the MA output.
  • Filter Options: Choose whether to apply the filter to the Price, the MA, Both, or None.
  • Filter Multiplier: Adjusts the sensitivity of the stepping filter.
  • Filter Period: The lookback period for the chosen filter type.

Bands Settings

  • Band Type: Determines the calculation method for the outer channels.
  • Band Multiplier: Sets the width of the channels.

UI Options

  • Color bars?: Toggles price bar coloring based on trend state.
  • Show signals?: Toggles the "L" (Long) and "S" (Short) labels on the chart.
  • Show bands?: Toggles the visibility of volatility channels.

FAQ

What is an N-tuple Moving Average? It is a moving average that has been smoothed multiple times by itself. For example, a 2-tuple is a Double MA, and a 3-tuple is a Triple MA. This indicator allows for up to 30 levels of nested smoothing.

How do the stepping functions help? Stepping functions act as a volatility filter. They prevent the indicator from reacting to minor price fluctuations, helping to stay in a trend until a significant move occurs in the opposite direction.

How do 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
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

ninjatraderNinjaTrader
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

metatrader4MetaTrader 4/5
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

thinkorswimThinkorswim
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

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.