STD-Stepped Fast Cosine Transform Moving Average
Aug 11, 2022

The STD-Stepped Fast Cosine Transform Moving Average indicator provides a specialized moving average that utilizes the Discrete Cosine Transform (DCT) and standard deviation stepping to filter market noise and highlight core trends. It applies frequency-domain processing to price data, weeding out low-volatility movements to produce a smoother, trend-responsive output.
Usage
The Usage section describes how the script can be used to identify trend direction and momentum shifts while minimizing noise.
- Trend Identification: Users can use the color-coded line and bar coloring to determine market bias. A green output typically indicates an uptrend, while a red output indicates a downtrend.
- Volatility Filtering: By adjusting the "Filter Deviations" and "Filter Period," the script can ignore minor price fluctuations. When the price or the MA does not move beyond a specific standard deviation threshold, the value remains "stepped" (flat), helping traders avoid entering during choppy, sideways markets.
- Frequency Control: The "Smoothing Period" setting allows for manual frequency pruning. Unlike traditional moving averages where higher numbers mean more smoothing, in this tool, lower values for the smoothing period result in a smoother, more filtered output by zeroing out higher frequencies.
Details
This script implements a Type-II Discrete Cosine Transform (DCT) to process price data. A DCT expresses a finite sequence of data points as a sum of cosine functions oscillating at different frequencies. In signal processing, this is often used for compression because it concentrates the signal energy into a few coefficients.
The "Fast" component refers to the use of a computational algorithm similar to the Fast Fourier Transform (FFT). To maintain high performance, the window length is restricted to powers of 2 (e.g., 16, 32, 64, etc.). After the initial FCT pass, the script applies a smoothing mechanism that discards high-frequency components based on the user-defined cutoff, effectively removing "jitter" from the price action.
Settings
- Heikin-Ashi Better Calculation Type: Determines the smoothing method (AMA, T3, or Kaufman) used for "HAB" source types.
- Source: Selection of the price data to be processed, including expanded options like Heikin-Ashi, Trend Biased, and Average Median Body prices.
- Window: The calculation period for the FCT, restricted to powers of 2 (16 to 2048) for computational efficiency.
- Smoothing Period: Controls frequency pruning; lower values produce a smoother line by discarding more high-frequency data.
- Filter Options: Choose whether to apply standard deviation stepping to the Price, the FCT MA, or both.
- Filter Deviations: Sets the standard deviation multiplier for the volatility filter; higher values lead to more "steps" and less sensitivity to small moves.
- Filter Period: The lookback period used for the standard deviation calculation within the volatility filter.
- Color bars?: Toggles price bar coloring based on the indicator's trend direction.
- Show signals?: Enables or disables on-chart visual signals for trend changes.
- Moving Average Inputs: Specific parameters (Fast/Slow ends) for Kaufman’s KAMA or Adaptive Moving Averages used in the source calculation.
FAQ
What is the benefit of using Fast Cosine Transform over a regular SMA? The FCT allows for more precise frequency filtering, enabling the indicator to respond to significant trend changes while ignoring high-frequency noise that often causes false signals in simple moving averages.
Why are the window sizes limited to powers of 2? The script uses a fast algorithm (similar to the Cooley-Tukey FFT) that requires an input matrix of power-of-2 size to maintain optimal calculation speed and performance on charting platforms.
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.
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.

