OPEN-SOURCE SCRIPT
Key Levels

What it does
It plots your key liquidity reference levels on NQ/ES/YM, all on a New York clock (America/New_York, auto EST/EDT), built for intraday timeframes. Every level is a horizontal line extended right with a right-margin label, so labels stay readable on any timeframe and don't squeeze the price scale.
Levels plotted
Sessions — Asia (18:00–02:29), London (02:30–06:59), NY AM (07:00–11:29). Each plots that session's high and low. They belong to the current trading day; at the close they clear off the chart and move to history.
NY Midnight Open (NYMO) — the 00:00 ET open.
9:30 Open — the cash-open price, now pulled from 30-minute data so it reads correctly on every timeframe (1H and higher included).
Prior Day H/L (PDH/PDL) — the trading day runs 18:00 → 16:59 next day, finalized at the close so it's visible all weekend. Keeps the last 3 days. Swept levels relabel "old" and switch to dashed.
Prior Week H/L (PWH/PWL) — Sunday 18:00 → Friday 16:59. Keeps the last 3 weeks. Same sweep relabel/dash behavior.
Trading-day logic
Everything rolls on the trading day (18:00 boundary, +6h shift), not the calendar day, and the weekend gap is handled so Friday's levels finalize correctly.
Backtesting / history
A "Show current day" toggle plus individual "Show N days back" toggles (1–5) let you bring archived session/anchor days back onto the chart one at a time. With current-day off during market close, the recent day's PD/PW previews now clear too.
Settings
Per-level color inputs (each controls both line and label), show/hide per level, and a global line width. NYMO and 9:30 default to black — recolor those for a dark chart.
It plots your key liquidity reference levels on NQ/ES/YM, all on a New York clock (America/New_York, auto EST/EDT), built for intraday timeframes. Every level is a horizontal line extended right with a right-margin label, so labels stay readable on any timeframe and don't squeeze the price scale.
Levels plotted
Sessions — Asia (18:00–02:29), London (02:30–06:59), NY AM (07:00–11:29). Each plots that session's high and low. They belong to the current trading day; at the close they clear off the chart and move to history.
NY Midnight Open (NYMO) — the 00:00 ET open.
9:30 Open — the cash-open price, now pulled from 30-minute data so it reads correctly on every timeframe (1H and higher included).
Prior Day H/L (PDH/PDL) — the trading day runs 18:00 → 16:59 next day, finalized at the close so it's visible all weekend. Keeps the last 3 days. Swept levels relabel "old" and switch to dashed.
Prior Week H/L (PWH/PWL) — Sunday 18:00 → Friday 16:59. Keeps the last 3 weeks. Same sweep relabel/dash behavior.
Trading-day logic
Everything rolls on the trading day (18:00 boundary, +6h shift), not the calendar day, and the weekend gap is handled so Friday's levels finalize correctly.
Backtesting / history
A "Show current day" toggle plus individual "Show N days back" toggles (1–5) let you bring archived session/anchor days back onto the chart one at a time. With current-day off during market close, the recent day's PD/PW previews now clear too.
Settings
Per-level color inputs (each controls both line and label), show/hide per level, and a global line width. NYMO and 9:30 default to black — recolor those for a dark chart.
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.