Multi Time Moving Average
Jun 7, 2019

The Multi Timeframe Moving Average indicator provides a comprehensive visualization of multiple moving averages across different timeframes on a single chart, enabling traders to identify key support and resistance levels from higher-tier periods.
Usage
The Usage section describes how the script can be used to monitor trends across various time horizons without switching charts. Traders can utilize this tool to confirm trend alignment or identify potential confluence points where multiple moving averages overlap.
- Standard Timeframes: By default, the indicator displays the 20, 50, 100, and 200 moving averages for the current chart timeframe, the Daily (1D) timeframe, and the Weekly (1W) timeframe.
- Customization: Users can toggle specific moving averages on or off to declutter the workspace. The script also supports two fully customizable moving averages where both the length and the source timeframe can be defined independently.
- Visual Identification: Labels are automatically generated at the end of each line to clearly identify the period and timeframe of the moving average. Line thickness also increases with the timeframe (Daily is thicker than Current, Weekly is thicker than Daily) to provide intuitive visual hierarchy.
Details
The script utilizes the request.security() function to fetch data from higher timeframes. It is designed with barmerge.lookahead_on to ensure that higher timeframe values are plotted accurately relative to the historical bars.
The tool supports two calculation methods: Simple Moving Average (SMA) and Exponential Moving Average (EMA). When a calculation type is selected in the settings, it applies to every active moving average globally. Additionally, the script includes built-in alert conditions for price crossovers with the 20-period moving average on both the current and daily timeframes.
Settings
- Choose MA type: Selects the calculation method (SMA or EMA) for all moving averages.
- Show current timeframe 4MA: Toggles the 20, 50, 100, and 200 MAs for the active chart timeframe.
- 1D MA Options: Individual toggles for the 20, 50, 100, and 200 MAs calculated on the Daily timeframe.
- 1W MA Options: Individual toggles for the 20, 50, 100, and 200 MAs calculated on the Weekly timeframe.
- Show 1/2 custom MA: Toggles the visibility of the two custom moving average slots.
- Custom MA Length: Sets the lookback period for the custom moving average.
- Custom MA Timeframe: Sets the specific timeframe (e.g., 4H, 12H, Monthly) for the custom moving average calculation.
FAQ
How do I switch between SMA and EMA? You can change the calculation type by opening the script settings and selecting your preferred method from the "Choose MA type" dropdown menu.
Can I display moving averages for timeframes other than Daily or Weekly? Yes, you can use the "Custom MA" slots in the settings to input any specific timeframe and length you require for your analysis.
How do I get access to the Multi Timeframe Moving Average? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.