OPEN-SOURCE SCRIPT
Zaktualizowano

Range MTF Lines

1 542
Range MTF Lines shows the direction of the current price range across four timeframes at once, as a compact strip in its own pane at the bottom of the chart.

How the range is defined

The first candle sets the initial range — its high and its low. The range stays alive for as long as candles keep closing inside it. The first candle that closes outside the range ends it, and that same candle's high and low immediately become the new range. Then it repeats.

Because every range is created by a close outside the previous one, each range is born with a direction:

Up (green) — it was created by a close above the old range
Down (red) — it was created by a close below the old range
Neutral (grey) — the very first range on the chart, which has no parent to break
What you see

Four rows, one per timeframe slot, at fixed heights: slot 1 on top, slot 4 at the bottom (defaults 5 / 15 / 30 / 60 minutes). Each row is coloured bar by bar with that timeframe's current range direction and is labelled with its timeframe at the right-hand end.

Because the rows live in their own pane at a fixed height, they never drift with price — you can zoom or scroll anywhere and the strip stays put and readable. Drag the pane divider to set how tall it is.

Reading it top to bottom tells you at a glance whether the short and long timeframes agree: all four green is broad one-way pressure, alternating colours means the lower timeframes are chopping inside a higher-timeframe range.

Settings

Row thickness — how chunky the rows are drawn
Tag rows with their timeframe — the label at the right end of each row
Per slot — show/hide, the timeframe, and separate colours for up, down and first range
Alert on break — per slot, fires on bar close when that timeframe forms a new range, and reports the new high and low
Each slot runs on its own timeframe independently of the chart's. A slot set to the chart timeframe is evaluated natively with no lag; higher timeframes are pulled in and track the live higher-timeframe bar.

Notes

This is a structure-reading tool, not a signal generator — it describes where price is relative to the ranges it keeps building, and nothing about the strip is predictive on its own. Ranges are decided on closes, so a wick outside the range does not end it. Companion script: Range Break Levels (MTF), which draws these same ranges on the candles themselves.
Informacje o Wersji
Cleaned up the timeframe tags on the rows.

Each row now carries a single timeframe label, at the right-hand end. The previous version repeated the tag every 500 bars along the row, which cluttered the strip for no real benefit.
Fixed duplicate labels piling up on a live chart. The label was being recreated on every bar as it went live, so a running chart slowly accumulated a trail of tags on the right-hand side. Each row now creates its label once and moves it along, so the strip stays clean no matter how long the chart is open.
No change to the range logic, the rows, or any setting — this is display only.
Informacje o Wersji
Fixed rows changing colour before their timeframe's candle had closed.

Each slot was reading the forming candle of its timeframe, so a 60-minute row would flip the instant price traded outside the range mid-candle — and flip back again if price returned before the hour was up. The strip could therefore show a direction that never actually happened, and it redrew differently on reload.

Every slot now reads only completed candles of its own timeframe. A 60-minute row cannot change until the 60-minute candle is finished, whatever price does inside it; a slot set to the chart timeframe holds its last confirmed value while the bar is forming and updates exactly on the close. The change still lands the moment the candle closes, so there is no added delay — and nothing repaints, so what you see live is what stays on the chart.

Break alerts inherit the same rule and now fire only on confirmed closes of their slot's timeframe.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.