OPEN-SOURCE SCRIPT
Trinity Multi-Timeframe MA Trend

User Guide: Trinity Multi-Timeframe MA Trend - 10 MAs Indicator
Welcome to the Trinity Multi-Timeframe MA Trend indicator! This is a versatile TradingView tool designed for traders who rely on moving averages to gauge trend direction across multiple timeframes. It supports up to 10 customizable moving averages (MAs), displays their trend directions in a compact dashboard, plots the MAs on the chart with color-coded trend indications, and optionally fills the areas between consecutive MAs for visual clarity. The indicator is built to help you quickly assess alignment between short-term and long-term trends, making it ideal for multi-timeframe analysis in strategies like trend following, swing trading, or confirming entry/exit points.
The core idea is to show whether each MA is in an uptrend (price above the MA's previous value) or downtrend (price below), not only on the current chart timeframe but also on up to 5 higher timeframes. This allows you to spot trend convergence or divergence at a glance, reducing the need to switch charts manually. The indicator is fully customizable, so you can tailor it to your preferred lengths, types, and visuals without cluttering your chart.
#### Key Features
- **Multi-Timeframe Dashboard**: A resizable and repositionable table that shows trend directions (↑ for up, ↓ for down) for each enabled MA across 5 user-defined timeframes. The cells are color-coded (green for up, red for down) with subtle background shading for easy reading.
- **Customizable Moving Averages**: Up to 10 MAs, each with independent length, type (EMA, SMA, or HMA), visibility, and transparency settings. You can enable/disable individual MAs to focus on specific ones.
- **Trend-Based Coloring**: Lines and fills change color based on the trend direction of the MA (green for uptrend, red for downtrend).
- **Background Fills**: Optional fills between consecutive MAs, colored according to the faster MA's trend, to highlight crossovers or trend strength visually.
- **Direction Change Arrows**: Small up/down arrows appear on the chart when an MA changes trend direction on the current timeframe, helping spot potential reversals.
- **Dynamic and Lightweight**: The dashboard adjusts automatically if you disable MAs (rows are hidden), and the indicator won't disappear from the chart even if all plots are turned off.
- **No Repainting Option**: Uses `lookahead_on` for security calls, so trends from higher timeframes are consistent but may repaint in realtime (standard for MTF indicators).
This indicator is particularly useful for traders using Fibonacci-based lengths (like your defaults: 5, 8, 13, 21, 34, 50, 100, 144, 200, 244), which align with natural market cycles. It's flexible for any asset class, from stocks and forex to crypto.
#### How the Indicator Works
The indicator calculates 10 moving averages on the current chart timeframe. For each MA, it determines the trend direction by comparing the current value to its value two bars ago (a simple slope check). It then fetches the same trend calculation from 5 higher timeframes using `request.security`, allowing you to see if the trend is aligned across scales.
The dashboard summarizes this in a grid:
- Rows: Each enabled MA (labeled as "Type Length", e.g., "EMA 5").
- Columns: The 5 timeframes (labeled with converted names, e.g., "5m" for 5-minute, "1D" for daily).
- Cells: ↑ (uptrend, green) or ↓ (downtrend, red), with background shading for emphasis.
On the chart:
- MAs are plotted as lines with trend colors and user-set transparency.
- Fills (if enabled) shade the area between MAs, inheriting the color from the faster MA's trend.
- Arrows appear above/below bars when an MA's trend changes on the current timeframe.
#### Setting Up the Indicator
Add the indicator to your chart in TradingView, then customize via the Inputs tab. The inputs are grouped for ease:
- **Timeframes Group**: Set the 5 higher timeframes for MTF analysis (defaults: 5m, 15m, 1h, 4h, 1D). Use standard TradingView notation like "15" for 15 minutes or "D" for daily.
- **Moving Averages Group**: Adjust lengths and types for each of the 10 MAs. Start with the Fibonacci defaults, but experiment (e.g., shorter for scalping, longer for investing).
- **Visibility Group**: Toggle "Show MA#" to enable/disable individual lines on the chart. Disabling hides the row in the dashboard too.
- **Background Fills Group**: Toggle fills between MAs. These are great for visualizing ribbon-like setups but can clutter busy charts—turn off if not needed.
- **Colors Group**: Set the uptrend (default lime) and downtrend (default red) colors for lines, fills, and dashboard cells.
- **Transparency Group**: Adjust opacity for each MA line (0 = fully opaque/solid, 100 = fully transparent/invisible). Defaults start low for visibility and increase for slower MAs to reduce clutter.
- **Dashboard Group**: Choose position (e.g., "Top Right") and size (e.g., "Normal") for the table. Resize to fit your screen.
After customizing, apply and refresh the chart if needed.
#### Interpreting the Dashboard
The dashboard is the heart of the indicator—use it to confirm trend alignment:
- **Strong Uptrend Signal**: Most cells in a row (or column) show ↑ in green, indicating the MA is upward on multiple timeframes.
- **Strong Downtrend Signal**: Mostly ↓ in red.
- **Divergence**: Mixed ↑/↓ across timeframes suggests caution (e.g., short-term up but long-term down could mean a pullback).
- **Trend Flip**: Watch for rows where the current timeframe cell changes—combine with arrows on the chart for entries.
For example, if you're on a 5m chart and the dashboard shows ↑ on all timeframes for your fast MAs (e.g., MA1-MA3), it's a good buy signal in an uptrend strategy.
#### Using the Chart Plots and Fills
- **MA Lines**: Each enabled MA is plotted with its trend color. Use transparency to layer them without overwhelming the price action—faster MAs (low transparency) stand out, slower ones (high transparency) fade into the background.
- **Fills**: These highlight the space between MAs. In an uptrend, green fills expanding mean strengthening momentum. In a downtrend, red fills contracting could signal a squeeze or reversal. Disable fills if you prefer clean lines.
- **Arrows**: Up arrow (↑) means the MA turned bullish; down (↓) means bearish. These are only on the current timeframe and can be used for alerts (e.g., set TradingView alerts on crossover conditions).
To avoid double lines, ensure no other indicators are plotting similar MAs. If you disable all "Show MA#" toggles, the chart should be clean, but the dashboard remains.
#### Customization and Advanced Usage
- **Strategy Integration**: Use the dashboard for confluence. For example, enter long only when 80% of cells are ↑. Pair with oscillators like RSI for overbought/oversold filters.
- **Scalping vs. Swing**: For short-term trading, focus on fast MAs (1–5) and lower timeframes. For long-term, emphasize slow MAs (6–10) and higher timeframes.
- **HMA vs. EMA/SMA**: HMA is smoother for noisy markets; EMA for responsiveness; SMA for simplicity. Test combinations.
- **Transparency Tips**: Start with low values (0–30) for key MAs to make them prominent. Increase for others to layer without clutter.
- **Dashboard Tips**: Position in "Top Right" for quick glances. Use "Small" size on mobile or crowded screens. If the table is too wide, reduce timeframes.
- **Performance Notes**: With 10 MAs and 5 timeframes, it uses 5 security calls—efficient but may lag on very old devices. Disable unused MAs to optimize.
- **Alerts**: Set alerts on trend changes, e.g., "MA1 trend up" via TradingView's alert setup on the indicator.
#### Troubleshooting
- **No Dashboard**: Ensure at least one MA is enabled and the chart has enough bars (zoom out if needed).
- **Double Lines**: Check for overlapping indicators or duplicates. Reload the chart or TradingView.
- **Repainting**: Higher timeframe trends may repaint in realtime—use for confirmation, not sole signals.
- **Transparency Not Working**: Adjust sliders in Inputs; values above 80 make lines faint. Test on a white background chart if using dark mode.
This indicator is inspired by multi-timeframe trend analysis tools like BigBeluga's original, with these modifications for transparency, fills, extra MA lines, more MA selections and dynamic table.
Original script: Multi-Timeframe Trend Analysis [BigBeluga]![Multi-Timeframe Trend Analysis [BigBeluga]](https://s3.tradingview.com/z/zfkp3wZA_mid.png)
All credit to the original author: tradingview.com/u/BigBeluga/
Modifications by 34EMATRADER
Welcome to the Trinity Multi-Timeframe MA Trend indicator! This is a versatile TradingView tool designed for traders who rely on moving averages to gauge trend direction across multiple timeframes. It supports up to 10 customizable moving averages (MAs), displays their trend directions in a compact dashboard, plots the MAs on the chart with color-coded trend indications, and optionally fills the areas between consecutive MAs for visual clarity. The indicator is built to help you quickly assess alignment between short-term and long-term trends, making it ideal for multi-timeframe analysis in strategies like trend following, swing trading, or confirming entry/exit points.
The core idea is to show whether each MA is in an uptrend (price above the MA's previous value) or downtrend (price below), not only on the current chart timeframe but also on up to 5 higher timeframes. This allows you to spot trend convergence or divergence at a glance, reducing the need to switch charts manually. The indicator is fully customizable, so you can tailor it to your preferred lengths, types, and visuals without cluttering your chart.
#### Key Features
- **Multi-Timeframe Dashboard**: A resizable and repositionable table that shows trend directions (↑ for up, ↓ for down) for each enabled MA across 5 user-defined timeframes. The cells are color-coded (green for up, red for down) with subtle background shading for easy reading.
- **Customizable Moving Averages**: Up to 10 MAs, each with independent length, type (EMA, SMA, or HMA), visibility, and transparency settings. You can enable/disable individual MAs to focus on specific ones.
- **Trend-Based Coloring**: Lines and fills change color based on the trend direction of the MA (green for uptrend, red for downtrend).
- **Background Fills**: Optional fills between consecutive MAs, colored according to the faster MA's trend, to highlight crossovers or trend strength visually.
- **Direction Change Arrows**: Small up/down arrows appear on the chart when an MA changes trend direction on the current timeframe, helping spot potential reversals.
- **Dynamic and Lightweight**: The dashboard adjusts automatically if you disable MAs (rows are hidden), and the indicator won't disappear from the chart even if all plots are turned off.
- **No Repainting Option**: Uses `lookahead_on` for security calls, so trends from higher timeframes are consistent but may repaint in realtime (standard for MTF indicators).
This indicator is particularly useful for traders using Fibonacci-based lengths (like your defaults: 5, 8, 13, 21, 34, 50, 100, 144, 200, 244), which align with natural market cycles. It's flexible for any asset class, from stocks and forex to crypto.
#### How the Indicator Works
The indicator calculates 10 moving averages on the current chart timeframe. For each MA, it determines the trend direction by comparing the current value to its value two bars ago (a simple slope check). It then fetches the same trend calculation from 5 higher timeframes using `request.security`, allowing you to see if the trend is aligned across scales.
The dashboard summarizes this in a grid:
- Rows: Each enabled MA (labeled as "Type Length", e.g., "EMA 5").
- Columns: The 5 timeframes (labeled with converted names, e.g., "5m" for 5-minute, "1D" for daily).
- Cells: ↑ (uptrend, green) or ↓ (downtrend, red), with background shading for emphasis.
On the chart:
- MAs are plotted as lines with trend colors and user-set transparency.
- Fills (if enabled) shade the area between MAs, inheriting the color from the faster MA's trend.
- Arrows appear above/below bars when an MA's trend changes on the current timeframe.
#### Setting Up the Indicator
Add the indicator to your chart in TradingView, then customize via the Inputs tab. The inputs are grouped for ease:
- **Timeframes Group**: Set the 5 higher timeframes for MTF analysis (defaults: 5m, 15m, 1h, 4h, 1D). Use standard TradingView notation like "15" for 15 minutes or "D" for daily.
- **Moving Averages Group**: Adjust lengths and types for each of the 10 MAs. Start with the Fibonacci defaults, but experiment (e.g., shorter for scalping, longer for investing).
- **Visibility Group**: Toggle "Show MA#" to enable/disable individual lines on the chart. Disabling hides the row in the dashboard too.
- **Background Fills Group**: Toggle fills between MAs. These are great for visualizing ribbon-like setups but can clutter busy charts—turn off if not needed.
- **Colors Group**: Set the uptrend (default lime) and downtrend (default red) colors for lines, fills, and dashboard cells.
- **Transparency Group**: Adjust opacity for each MA line (0 = fully opaque/solid, 100 = fully transparent/invisible). Defaults start low for visibility and increase for slower MAs to reduce clutter.
- **Dashboard Group**: Choose position (e.g., "Top Right") and size (e.g., "Normal") for the table. Resize to fit your screen.
After customizing, apply and refresh the chart if needed.
#### Interpreting the Dashboard
The dashboard is the heart of the indicator—use it to confirm trend alignment:
- **Strong Uptrend Signal**: Most cells in a row (or column) show ↑ in green, indicating the MA is upward on multiple timeframes.
- **Strong Downtrend Signal**: Mostly ↓ in red.
- **Divergence**: Mixed ↑/↓ across timeframes suggests caution (e.g., short-term up but long-term down could mean a pullback).
- **Trend Flip**: Watch for rows where the current timeframe cell changes—combine with arrows on the chart for entries.
For example, if you're on a 5m chart and the dashboard shows ↑ on all timeframes for your fast MAs (e.g., MA1-MA3), it's a good buy signal in an uptrend strategy.
#### Using the Chart Plots and Fills
- **MA Lines**: Each enabled MA is plotted with its trend color. Use transparency to layer them without overwhelming the price action—faster MAs (low transparency) stand out, slower ones (high transparency) fade into the background.
- **Fills**: These highlight the space between MAs. In an uptrend, green fills expanding mean strengthening momentum. In a downtrend, red fills contracting could signal a squeeze or reversal. Disable fills if you prefer clean lines.
- **Arrows**: Up arrow (↑) means the MA turned bullish; down (↓) means bearish. These are only on the current timeframe and can be used for alerts (e.g., set TradingView alerts on crossover conditions).
To avoid double lines, ensure no other indicators are plotting similar MAs. If you disable all "Show MA#" toggles, the chart should be clean, but the dashboard remains.
#### Customization and Advanced Usage
- **Strategy Integration**: Use the dashboard for confluence. For example, enter long only when 80% of cells are ↑. Pair with oscillators like RSI for overbought/oversold filters.
- **Scalping vs. Swing**: For short-term trading, focus on fast MAs (1–5) and lower timeframes. For long-term, emphasize slow MAs (6–10) and higher timeframes.
- **HMA vs. EMA/SMA**: HMA is smoother for noisy markets; EMA for responsiveness; SMA for simplicity. Test combinations.
- **Transparency Tips**: Start with low values (0–30) for key MAs to make them prominent. Increase for others to layer without clutter.
- **Dashboard Tips**: Position in "Top Right" for quick glances. Use "Small" size on mobile or crowded screens. If the table is too wide, reduce timeframes.
- **Performance Notes**: With 10 MAs and 5 timeframes, it uses 5 security calls—efficient but may lag on very old devices. Disable unused MAs to optimize.
- **Alerts**: Set alerts on trend changes, e.g., "MA1 trend up" via TradingView's alert setup on the indicator.
#### Troubleshooting
- **No Dashboard**: Ensure at least one MA is enabled and the chart has enough bars (zoom out if needed).
- **Double Lines**: Check for overlapping indicators or duplicates. Reload the chart or TradingView.
- **Repainting**: Higher timeframe trends may repaint in realtime—use for confirmation, not sole signals.
- **Transparency Not Working**: Adjust sliders in Inputs; values above 80 make lines faint. Test on a white background chart if using dark mode.
This indicator is inspired by multi-timeframe trend analysis tools like BigBeluga's original, with these modifications for transparency, fills, extra MA lines, more MA selections and dynamic table.
Original script: Multi-Timeframe Trend Analysis [BigBeluga]
![Multi-Timeframe Trend Analysis [BigBeluga]](https://s3.tradingview.com/z/zfkp3wZA_mid.png)
All credit to the original author: tradingview.com/u/BigBeluga/
Modifications by 34EMATRADER
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.