MTF Custom Moving Averages
Feb 15, 2022

The MTF Custom Moving Averages indicator provides a flexible framework for plotting up to 10 independent moving averages with customizable timeframes, types, and visual fills. This tool enables traders to monitor multiple trend horizons simultaneously on a single chart, facilitating the identification of cross-timeframe support, resistance, and trend convergences.
Usage
The Usage section describes how the script can be used to streamline multi-timeframe analysis. Users can toggle individual moving averages to suit specific asset classes or strategies. For example, a trader can monitor a "Bull Market Support Band" using a Weekly 21 EMA and 20 SMA alongside short-term 4-hour moving averages to spot potential "death crosses" or trend shifts.
The script supports "Fills," allowing users to color the area between two consecutive moving averages (e.g., MA1 and MA2). This visual aid helps identify the distance between averages, which often signifies trend strength or mean reversion potential. A "Temporary Timeframe Override" feature is also included, allowing users to temporarily snap all active moving averages to the current chart timeframe for immediate relative comparison without losing their original settings.
Details
The script utilizes the request.security() function to fetch data from different timeframes. It allows each moving average to be set as either an Exponential Moving Average (EMA) or a Simple Moving Average (SMA). The implementation includes a formatting function to simplify timeframe labels (e.g., converting "240" to "4h" and "1D" to "D"), ensuring the on-chart labels remain concise and readable. The "Fill" logic dynamically calculates the relationship between two lines, applying the color of the leading moving average to the shaded area to indicate trend directionality.
Settings
- Temporary Timeframe Override: When enabled, it forces all active moving averages to use the timeframe of the current chart.
- MA Visibility (MA1-MA10): Toggles the visibility of each individual moving average.
- Length (Len): Sets the lookback period for the specific moving average calculation.
- Timeframe (Per): Defines the source timeframe for the calculation (e.g., 5m, 1h, Daily, Weekly).
- Type: Selects between EMA (Exponential) or SMA (Simple) calculation methods.
- Color: Customizes the line color for the specific moving average.
- Fill MA(X):MA(Y): Toggles the background shading between two specified moving averages.
- Fill Transparency: Adjusts the opacity of the shaded areas between lines.
- Show Labels: Toggles the visibility of on-chart text descriptions for active moving averages.
- Label Size: Adjusts the font size of the on-chart labels.
FAQ
How do I enable the shading between two specific lines? In the settings menu, locate the "Fill" checkbox associated with the specific pair of moving averages (e.g., "Fill MA1:MA2") and ensure both moving averages are set to visible.
Can I use this for both long-term and short-term trends simultaneously? Yes, by configuring separate slots for different timeframes (e.g., setting MA1 to 15m and MA10 to Monthly), you can monitor different trend cycles on the same price chart.
How do I access the MTF Custom Moving Averages? 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.

