OPEN-SOURCE SCRIPT

Key Levels for Futures

718
What this does
Key Levels draws the ten reference prices that most intraday traders end up marking by hand
every morning: the previous month's high and low, the previous week's, the previous day's
regular-session high and low, the London session's, and the premarket's.
They are drawn automatically, they update themselves, and — the part that took the most work —
their tags stay on screen no matter where you scroll.
The ten levels
Tag
Level
Window
MH / ML
Previous month high and low
calendar month
WH / WL
Previous week high and low
calendar week
PDH / PDL
Previous day high and low
RTH 09:30–16:00 ET
LH / LL
London high and low
03:00–08:00 ET
PMH / PML
Premarket high and low
04:00–09:30 ET
Every window is an input, so if your definition of London or premarket differs from mine, change
it. ICT traders who want the London killzone instead of the full session can set it to
0200-0500.
Colour tells you two things at once
Most level indicators give you a pile of horizontal lines that all look alike, and you end up
squinting at the tag to work out what you are looking at. This one encodes the information in
the colour itself.
Hue tells you the timeframe. The palette runs cool to warm as the timeframe shortens:
Violet — monthly, the most structural
Blue — weekly
Cyan — previous day
Amber — London, overnight
Magenta — premarket, the most immediate
Shade tells you the side. Lighter for the high, deeper for the low.
So a deep violet line is the previous month's low and you know that at a glance, without
reading anything. Weekly and monthly levels also draw one step thicker than the intraday ones,
so the structural prices read first when the chart gets busy.
All ten colours, the line width, the tag size and the tag position are inputs. If you disagree
with the palette, it takes ten seconds to change.
Tags that do not run away
The usual approach puts level tags a fixed number of bars to the right of the last candle.
Scroll back to look at something and the tags vanish off the right edge, and you are left
guessing which line is which.
These tags anchor to chart.right_visible_bar_time, so they sit at the right edge of whatever
you are currently looking at. Scroll, zoom, jump back three weeks — the tags come with you and
stay readable. Each shows its abbreviation and, optionally, the exact price.
Weekly and monthly: settled or developing
Both default to the previous completed period — a level that is finished and will not move,
which is how PDH and PDL already behave and what most people mean when they say "last week's
high."
Flip either to Current and it tracks the developing period instead. Those draw dotted
rather than solid, so at a glance you can tell the difference between a level that is fixed and
one that can still be extended by the next candle.
On repainting
Nothing here repaints.
The previous week and month values are read with the standard [1] offset and lookahead_on,
which returns the last completed period and nothing about the current one. The developing week
and month values are accumulated bar by bar on the chart series, so no higher-timeframe request
is involved at all. The session levels build up from the bars as they close.
A level appears when the data that defines it exists, and never changes afterwards.
Settings
Show / Hide — every pair independently. Ten levels is a lot on a quiet chart; turn off what
you are not using today.
Sessions — the London, premarket and RTH windows, plus previous-vs-current toggles for the
week and month.
Style — line width (weekly and monthly automatically draw one step heavier), how far the
tags sit in from the right edge, tag size from tiny to normal, and whether to include the price
in the tag.
Colors — all ten, individually.
Notes
Use an intraday chart. Session windows mean nothing on a daily or higher chart, and the
indicator will tell you so on screen.
On stocks, enable Extended Trading Hours or the premarket and London bars will not exist
and those levels will stay blank. Futures are fine as they are.
Session levels are calculated on the chart timeframe. On any timeframe whose bars line up
with the session boundaries — 1, 2, 3, 5, 10, 15, 30 and 60 minute all do, since the windows
start on the hour or the half hour — this is exact. On an unusual timeframe such as 7 minutes,
a level can be off by one bar's high or low.
Ten tags will overlap when levels cluster. Drop the tag size to Tiny or hide the pairs you
are not watching.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.