PROTECTED SOURCE SCRIPT
Aggiornato

Multi Time Frame Moving Average Contact Signal

55
Multi Time Frame Moving Average Contact Signal

Creates a contact symbol when MTFMA is close or touched
Note di rilascio
English (TradingView Description)

MTF MA Contacts v35.3 highlights price contacts with multiple Moving Averages (SMA = X, EMA = O) from Weekly and/or Daily-converted weekly lengths. It uses labels instead of plots (avoids plot limits) and includes a dynamic table.

Features:
Selectable MA lengths (e.g., 10, 13, 20, 21, 26, 30, 31, 34, 40, 50, 52, 65, 100, 104, 150, 156, 200, 260) with individual colors.

MTF logic: Weekly MAs plus optional Daily MAs using weekly→daily conversion (Days/week adjustable).

Contact modes:
Wick touch (range)
Close cross
Close within tolerance


Note di rilascio
What this indicator does

This script detects price “contacts” with multiple moving averages (SMA and/or EMA) on Weekly (W) and/or Daily (D) timeframes, and marks those contacts on your chart using labels:

“X” = SMA contact
“O” = EMA contact

It also displays a dynamic table showing:
Which MA lengths are enabled
Support/Resistance hit counts per length (S/R)
An overall UP/DOWN direction estimate based on short MA behavior

This tool is designed to help you identify which MA lengths act as “magnets”, supports, or resistances over a chosen lookback window.

Core concepts

1) Contact modes
You can choose how a “contact” is defined:
Wick touch (range)
A contact occurs if the candle’s low/high range touches the MA (with optional tolerance).
Close cross
A contact occurs if close crosses the MA.
Close within tolerance
A contact occurs if the close is within tolerance of the MA.

2) Tolerance
Tolerance expands the “contact zone” around the MA:
None: exact touch/cross logic only
Percent: MA ± (MA × %)
ATR: MA ± (ATR × multiplier)

Ticks: MA ± (mintick × value)

Timeframe logic (MTF)
You can enable:
Weekly (W) MAs
Daily (D) MAs (but using “weekly lengths converted”)
“Daily (weekly lengths converted)”
If enabled, the script converts weekly lengths into daily lengths using:

dailyLength = weeklyLength × Days/week
Default is 5 trading days per week.

Example:
Weekly 20 becomes Daily 100 (20 × 5)

Markers (labels)
Marker placement
Markers above candles: labels placed above highs
Otherwise placed below lows
Marker text options

X/O: only “X” or “O”
X/O+Len: e.g., “X20”, “O13”

Len only: e.g., “20”

Marker sizing

You can set Marker size to:
Tiny / Small / Normal / Large / Huge

Stack handling
When multiple hits happen on the same bar, labels are stacked vertically (ATR-based spacing).

Filters and noise control
Only on bar close

If enabled, signals are only processed on confirmed bars.
Only first touch (no repeated contacts)
Prevents repeated touches from spamming the chart by only counting the first contact until the condition resets.

Cooldown bars
Requires a minimum number of bars between contacts for the same MA length.
Quality filter (ATR distance)
If enabled, a contact is only valid if the distance from close to MA is below:
ATR × Max dist (ATR)
Multiple hits handling (priority mode)
If several MA lengths hit on the same bar:

All: mark/count all hits
Longest only: keep only the longest MA length hit
Closest to close only: keep only the MA closest to the close

Counts and timeframe window
Counts timeframe

Since load: counts from the moment you add the indicator
Last N bars: rolling window counts
Count lookback (bars)
If “Last N bars” is selected, this defines the rolling window size.

Table (right-side panel)
Table auto sizing

The table automatically adjusts its number of rows based on the number of enabled MA lengths.
Table corner

You can choose where the table sits:
Top Right / Top Left / Bottom Right / Bottom Left

Table text size
Tiny / Small / Normal / Large / Huge
Understanding the S/R column
The table shows S/R = Support / Resistance contacts for each length.
Definition used:

Support: contact and the candle closes at or above the selected MA
Resistance: contact and the candle closes below the selected MA
Example:

13 → 11/5 means: 11 support contacts, 5 resistance contacts.

Direction (UP / DOWN / NEUTRAL)
The script computes a direction score mainly from the short MA group:
10 / 13 / 20 / 21 / 26

Bias component (S/R dominance)
More support than resistance → bullish bias

More resistance than support → bearish bias
Optional slope component (MA trend)
If enabled, it also checks whether short MAs are rising or falling over:

Slope lookback (bars)
Final direction output
Displayed in the table:

Dir: UP / DOWN / NEUTRAL
Str: strength % (absolute size of the score)
Bias: bias % (support-resistance dominance)

Typical interpretation:
UP + high strength: short MAs behaving like support and/or rising
DOWN + high strength: short MAs behaving like resistance and/or falling
NEUTRAL: mixed S/R behavior (often chop/range)

Recommended settings (practical)

For “market structure / swing chop”:
Contact mode: Wick touch (range)
Tolerance: Percent 0.5–1.0 or ATR 0.3–0.8

Priority mode: All
Count mode: Last N bars (250–500)
Enable: Daily (converted) and optionally Weekly
Keep EMA off at first if you want cleaner signals
For “trend confirmation”:
Contact mode: Close cross
Enable slope: ON
Quality filter: ON with smaller ATR cap (e.g., 0.3–0.5)
Note di rilascio
MTF MA Contacts highlights when price “interacts” with important moving averages from higher timeframes, and summarizes that behavior in a small table.

The script places small labels when price contacts a moving average:
X = SMA contact
O = EMA contact

A “contact” can be defined in different ways (you choose):
Wick touch (price range touches the MA)
Close cross (close crosses the MA)
Close near MA (close is within a tolerance)

Multi-timeframe (MTF)
You can track:
Weekly MAs (W)
Daily MAs (D)
If “Daily (weekly lengths converted)” is enabled, weekly lengths are converted into daily lengths using Days/week (default 5).

Table (right side)

The table lists your enabled MA lengths and shows:
Len = the MA length
SMA / EMA = whether SMA/EMA is enabled
S/R = Support vs Resistance counts for that length:
Support = price contacts the MA and closes at/above it
Resistance = price contacts the MA and closes below it
Example: 11/5 means 11 support contacts and 5 resistance contacts.

Direction & State (trend bias)
At the bottom the script estimates short-term direction using the short MA group (10/13/20/21/26):
Dir = UP / DOWN / NEUTRAL
Str = how strong that direction signal is

It also prints a simple State label:
  1. Bull Confirmed = UP + support dominates
  2. Bull Pullback = UP + resistance dominates
  3. Bear Confirmed = DOWN + resistance dominates
  4. Bear Rally = DOWN + support dominates
  5. Range / Mixed = unclear / choppy conditions
  6. Bias = whether contacts are more support or resistance (in %)


Useful options (quick meaning)
  1. Tolerance: makes contacts easier/harder to trigger (Percent / ATR / Ticks)
  2. Only on bar close: reduces noise by confirming signals on closed candles
  3. Cooldown / First touch only: reduces repeated signals in chop
  4. Priority mode: if many MAs hit on one bar, choose All / Longest / Closest
  5. Counts timeframe: count since load, or only the last N bars
  6. Table corner / Text size / Marker size: visual customization


In short: the script tells you which MA lengths price respects most, whether they act more like support or resistance, and gives a quick UP/DOWN bias based on that interaction.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.