OPEN-SOURCE SCRIPT
HTF/LTF Alignment ("Trend Is your Friend, Until the end!")

HTF/LTF Alignment Dashboard
A clean multi-timeframe bias dashboard built around the 9 and 13 EMA. Tracks 9/13 EMA direction across three user-defined timeframes simultaneously and shows whether they're aligned at a glance — without making you flip charts.
What it does
Reads the 9 EMA (blue) and 13 EMA (grey) on three independently selectable timeframes (defaults: 1H / 15m / 5m) and prints the result as a compact dashboard on your chart. Each timeframe is color-coded — green when 9 EMA is above 13 EMA (bullish), red when below (bearish). A single alignment indicator at the top of the table reads "HTF/LTF Aligned" with a light blue dot when all three timeframes agree, grey when they don't.
The dashboard works on any chart timeframe. The three TFs in the table are pulled independently of what you're viewing, so you can sit on a 1m execution chart and still read 1H bias.
How to use it
1. Trend continuation — the cleanest setup
When all three TFs are aligned (blue dot lit), you're in a confirmed trending regime where higher and lower timeframes agree. This is the highest-probability environment to take continuation trades — pullbacks to value, breakouts, retests of broken structure. Trend is your friend, until the end. Trade with the alignment, not against it.
2. Possible reversal — read the flip cascade
The order in which timeframes change is the early-warning system. Reversals almost always start small and work outward:
LTF flips first → first crack, often just noise on its own
MTF flips → trend in your execution window has rolled
HTF flips → regime change confirmed
If you're holding a position in a fully-aligned market and the LTF flips against you, that's your cue to tighten stops, scale out, or stop adding. If two TFs have flipped and only the HTF holds, you're in the danger zone — the trend is dying. A full new-direction alignment (all three flip and re-agree) is the cleanest signal that the reversal is real, not a wick.
3. Top-down bias filter
Set TF1 to your bias timeframe, TF2 to your structure timeframe, TF3 to your execution timeframe. Only take longs when all three show BULL. Only take shorts when all three show BEAR. When the alignment dot is grey, the market is in transition — stand down or wait for it to settle.
4. Confluence trigger
Watch for the dot flipping from grey to light blue. That moment marks all three TFs agreeing for the first time and frequently coincides with momentum kicks and continuation legs. Pair it with your own entry trigger — structure break, pullback to a key level, breakout retest, or whatever you already use.
5. Don't fight the tide check
If your HTF row is BEAR and you're tempted to long an LTF setup, the dashboard sitting grey is the visual reminder you're trading against the higher tide. Reduce size, skip the trade, or wait for alignment to come to you.
Settings
Three timeframes, fully editable (HTF / MTF / LTF)
Table position: any of four corners or middle sides
Table size: Tiny / Small / Normal / Large
Every color editable — cell backgrounds, text colors, frame, borders, alignment indicator
Optional plot of the 9/13 EMA on the current chart (off by default; 9 = blue, 13 = grey)
"Use confirmed values only" toggle for non-repainting bias (locks each TF until that bar closes)
Three alerts: bullish alignment fired, bearish alignment fired, alignment lost
Notes
Default mode shows live developing bias — values can update intra-bar until each TF's bar closes. Flip on "Use confirmed values only" if you prefer locked, non-repainting values. For best data fidelity, keep your chart timeframe equal to or lower than the lowest TF in your dashboard. Works on any market — futures, FX, equities, crypto.
This is a bias and confluence tool. It won't tell you exactly where to enter or exit on its own — it shows you when the trend stack agrees, when it doesn't, and when it's starting to come apart
A clean multi-timeframe bias dashboard built around the 9 and 13 EMA. Tracks 9/13 EMA direction across three user-defined timeframes simultaneously and shows whether they're aligned at a glance — without making you flip charts.
What it does
Reads the 9 EMA (blue) and 13 EMA (grey) on three independently selectable timeframes (defaults: 1H / 15m / 5m) and prints the result as a compact dashboard on your chart. Each timeframe is color-coded — green when 9 EMA is above 13 EMA (bullish), red when below (bearish). A single alignment indicator at the top of the table reads "HTF/LTF Aligned" with a light blue dot when all three timeframes agree, grey when they don't.
The dashboard works on any chart timeframe. The three TFs in the table are pulled independently of what you're viewing, so you can sit on a 1m execution chart and still read 1H bias.
How to use it
1. Trend continuation — the cleanest setup
When all three TFs are aligned (blue dot lit), you're in a confirmed trending regime where higher and lower timeframes agree. This is the highest-probability environment to take continuation trades — pullbacks to value, breakouts, retests of broken structure. Trend is your friend, until the end. Trade with the alignment, not against it.
2. Possible reversal — read the flip cascade
The order in which timeframes change is the early-warning system. Reversals almost always start small and work outward:
LTF flips first → first crack, often just noise on its own
MTF flips → trend in your execution window has rolled
HTF flips → regime change confirmed
If you're holding a position in a fully-aligned market and the LTF flips against you, that's your cue to tighten stops, scale out, or stop adding. If two TFs have flipped and only the HTF holds, you're in the danger zone — the trend is dying. A full new-direction alignment (all three flip and re-agree) is the cleanest signal that the reversal is real, not a wick.
3. Top-down bias filter
Set TF1 to your bias timeframe, TF2 to your structure timeframe, TF3 to your execution timeframe. Only take longs when all three show BULL. Only take shorts when all three show BEAR. When the alignment dot is grey, the market is in transition — stand down or wait for it to settle.
4. Confluence trigger
Watch for the dot flipping from grey to light blue. That moment marks all three TFs agreeing for the first time and frequently coincides with momentum kicks and continuation legs. Pair it with your own entry trigger — structure break, pullback to a key level, breakout retest, or whatever you already use.
5. Don't fight the tide check
If your HTF row is BEAR and you're tempted to long an LTF setup, the dashboard sitting grey is the visual reminder you're trading against the higher tide. Reduce size, skip the trade, or wait for alignment to come to you.
Settings
Three timeframes, fully editable (HTF / MTF / LTF)
Table position: any of four corners or middle sides
Table size: Tiny / Small / Normal / Large
Every color editable — cell backgrounds, text colors, frame, borders, alignment indicator
Optional plot of the 9/13 EMA on the current chart (off by default; 9 = blue, 13 = grey)
"Use confirmed values only" toggle for non-repainting bias (locks each TF until that bar closes)
Three alerts: bullish alignment fired, bearish alignment fired, alignment lost
Notes
Default mode shows live developing bias — values can update intra-bar until each TF's bar closes. Flip on "Use confirmed values only" if you prefer locked, non-repainting values. For best data fidelity, keep your chart timeframe equal to or lower than the lowest TF in your dashboard. Works on any market — futures, FX, equities, crypto.
This is a bias and confluence tool. It won't tell you exactly where to enter or exit on its own — it shows you when the trend stack agrees, when it doesn't, and when it's starting to come apart
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.