OPEN-SOURCE SCRIPT

MTF Confluence - Timeframe Alignment Statistics [Dots3Red]

3 955
⏱️ MTF CONFLUENCE - TIMEFRAME ALIGNMENT STATISTICS [Dots3Red]
"Check the higher timeframe for confluence" is standard advice in almost every trading style. What's rarely measured is whether it actually matters on a given chart:
Does price behave differently when all three timeframes agree versus when only one does?
This script tracks that directly instead of assuming the answer.

✨ WHY THIS MATTERS
Multi-timeframe alignment is treated as an obvious edge, but "obvious" and "measured" are different things. A trader checking three timeframes by eye still has to decide, in the moment, whether 2-out-of-3 agreement is worth acting on and whether it behaves any differently than full 3-out-of-3 agreement. This script answers that with your own chart's history instead of a guess.

📊 Three alignment tiers, each with its own track record
Every time your current chart and its two higher timeframes shift into a new combined alignment — 1-out-of-3, 2-out-of-3, or 3-out-of-3 — that specific tier is logged and later graded on whether price actually continued. Over time each tier builds its own independent continuation rate, so you can see whether stronger alignment genuinely performs better here, or whether it doesn't.

⚙️ HOW IT WORKS
📐 Directional classification per timeframe — the current chart and two higher timeframes you choose are each classified Bull, Bear, or Neutral, using price relative to a moving average, filtered by ADX so a directionless timeframe isn't forced into a false read.

🔢 Confluence count — how many of the three timeframes agree with the current chart's direction, shown live as a simple count out of 3.

🎯 Rolling, honest grading — a new alignment event (the confluence count reaching a new tier in a direction) is logged and only graded once price has either continued a defined distance in that direction or the outcome window has elapsed — never recalculated with hindsight.

🔒 Non-repainting — every higher-timeframe read and every graded outcome is confirmed-bar only.

🎨 Visual markers — a label appears at each new alignment event showing the count reached, and the background tints when full 3-out-of-3 alignment is active.

🧭 HOW TO USE
1️⃣ Let each tier accumulate events before trusting its percentage. A tier with a low n hasn't said anything meaningful yet — the dashboard shows the sample size next to every percentage for exactly this reason.

2️⃣ Compare the tiers against each other. The point isn't a single number — it's whether 3/3 alignment actually continues more often than 2/3, or 1/3, on this specific chart. Any pattern (or lack of one) is a real answer.

3️⃣ Read the dashboard for the full picture, the chart markers for the moment. The table tracks the running statistics across every event this chart has produced; the labels and background tint mark when a new alignment tier is active right now.

4️⃣ Set your two higher timeframes to match your own trading horizon. A scalper's "higher timeframe" pairing looks nothing like a swing trader's — the statistics are only meaningful when the timeframes you choose reflect how you actually structure trades.

5️⃣ Treat a tier's continuation rate as descriptive, not predictive. It reflects what has happened historically at that alignment level on this chart — not a guarantee for the next occurrence.

⏱️ WHICH TIMEFRAMES WORK BEST
Applies to the current chart's timeframe generally, with 15-minute through 4-hour as the base chart giving the best balance — frequent enough for alignment events to recur and build a meaningful sample, while each event still reflects settled price behavior. The two higher timeframes should sit meaningfully above your base chart (e.g. 1H and 4H above a 15m chart, or 4H and Daily above a 1H chart) for the confluence read to add real information rather than three highly correlated copies of the same short-term move.

🛠️ SETTINGS
⏱️ Timeframes — two independently configurable higher timeframes

📐 Classification — trend MA length (applied uniformly across all three timeframes), ADX length, minimum ADX for a directional read

🎯 Outcome Grading — continuation confirmation distance (×ATR), outcome window (bars)

🎨 Visualization — alignment change labels, background tint at full alignment, independent bullish/bearish colors

🖥️ Dashboard — show/hide, position — each timeframe's current direction, live confluence count, per-tier continuation rate and sample size, total logged events

📝 NOTES
The statistics shown are specific to this chart, this timeframe combination, and these settings — they do not transfer to other instruments or timeframe pairings. The goal isn't to assert that more alignment is always better, but to replace that assumption with a measured answer for the setup you're actually trading.

⚠️ DISCLAIMER
This is an analytical and visualization tool. It does not generate trade signals and does not constitute financial advice. Historical statistics do not guarantee future performance.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน