OPEN-SOURCE SCRIPT
Aktualisiert

Multi-timeframe Moving Average Overlay w/ Sentiment Table

4 349
🔍 Overview
This indicator overlays selected moving averages (MA) from multiple timeframes directly onto the chart and provides a dynamic sentiment table that summarizes the relative bullish or bearish alignment of short-, mid-, and long-term moving averages.

It supports seven moving average types — including traditional and advanced options like DEMA, TEMA, and HMA — and provides visual feedback via table highlights and alerts when strong momentum alignment is detected.

This tool is designed to support traders who rely on multi-timeframe analysis for trend confirmation, momentum filtering, and high-probability entry timing.

⚙️ Core Features
Multi-Timeframe MA Overlay:
Plot moving averages from 1-minute, 5-minute, 1-hour, 1-day, 1-week, and 1-month timeframes on the same chart for visual trend alignment.

Customizable MA Type:
Choose from:

  • EMA (Exponential Moving Average)
  • SMA (Simple Moving Average)
  • DEMA (Double EMA)
  • TEMA (Triple EMA)
  • WMA (Weighted MA)
  • VWMA (Volume-Weighted MA)
  • HMA (Hull MA)


Adjustable MA Length:
Change the length of all moving averages globally to suit your strategy (e.g. 9, 21, 50, etc.).

Sentiment Table:
Visually track trend sentiment across four key zones (Hourly, Daily, Weekly, Monthly). Each is based on the relative positioning of short-term and long-term MAs.

Sentiment Symbols Explained:

  • ↑↑↑: Strong bullish momentum (short-term MAs stacked above longer-term MAs)
  • ↑↑ / ↑: Moderate bullish bias
  • ↓↓↓: Strong bearish momentum
  • ↓↓ / ↓: Moderate bearish bias


Table Customization:
Choose the table’s position on the chart (bottom right, top right, bottom left, top left).

Style Customization:
Display MA lines as standard Line or Stepline format.

Color Customization:
Individual colors for each timeframe MA line for visual clarity.

Built-in Alerts:
Receive alerts when strong bullish (↑↑↑) or bearish (↓↓↓) sentiment is detected on any timeframe block.

📈 Use Cases
1. Trend Confirmation:
Use sentiment alignment across multiple timeframes to confirm the overall trend direction before entering a trade.

2. Entry Timing:
Wait for a shift from neutral to strong bullish or bearish sentiment to time entries during pullbacks or breakouts.

3. Momentum Filtering:
Only trade in the direction of the dominant multi-timeframe trend. For example, ignore long setups when all sentiment blocks show bearish alignment.

4. Swing & Intraday Scalping:
Use hourly and daily sentiment zones for swing trades, or rely on 1m/5m MAs for precise scalping decisions in fast-moving markets.

5. Strategy Layering:
Combine this overlay with support/resistance, RSI, or volume-based signals to enhance decision-making with multi-timeframe context.

⚠️ Important Notes
Lower-timeframe values (1m, 5m) may appear static on higher-timeframe charts due to resolution limits in TradingView. This is expected behavior.

The indicator uses MA stacking, not crossover events, to determine sentiment.
Versionshinweise
Fixed sentiment table logic. The different time periods had inconsistencies. Now the logic has been standardized to the following truth table:

High Mid Low
-2 -1 0 ↑↑↑
-1 -2 0 ↑↑
-1 0 -2 ↑
-2 0 -1 ↓
0 -2 -1 ↓↓
0 -1 -2 ↓↓↓

-2 is two time periods shorter than the sentiment period.
-1 is one time period showerer than the sentiment period.
0 is the sentiment period.

For example, the 1-hour sentiment has the following logic:
1m line > 5m line > 1H line = -2, -1, 0 = ↑↑↑
1H line > 1m line > 5m line = 0, -2, -1 = ↓↓

I also added optional fill fades between moving average lines and the price of the stock. This was done per user requests. The indicator doesn't start with the fill fades or the sentiment table enabled. You need to toggle them on manually when you first add the indicator.

Finally, I changed some of the variable names to state "ma" instead of "ema" to make the code a bit cleaner for anyone trying to read/decipher the script.
Versionshinweise
The truth table for the weekly and monthly sentiment had a couple of errors, resulting in not all possible conditions aligning with a unique sentiment level. The weekly and monthly logic has been corrected to match the hourly and daily.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.