OPEN-SOURCE SCRIPT
Cập nhật Key Pivot Levels - By Sajan

A clean, multi-timeframe key level indicator built for intraday futures/index traders working off higher-timeframe structure.
What it plots:
Daily 50 & 200 SMA — long-term trend anchors
4H 50 & 200 SMA — swing-level bias
1H 50 & 200 SMA — intraday trend filter
Overnight session high/low (Globex, default 18:00–09:30 ET)
Previous day's RTH high/low (default 09:30–16:00 ET, New York session)
Session opening price (RTH open)
All levels are drawn as full-width horizontal lines with a colored price label tagged at the current level, so you always know exactly where each level sits relative to price — no hunting through
multiple timeframes manually.
Why it's useful:
Instead of flipping between daily/4H/1H charts to track moving averages, or manually marking overnight and prior-day highs/lows every session, this indicator pulls everything into one view on your working timeframe. Great for ORB, fib confluence, or KPL-based strategies that lean on higher-timeframe SMA + session level confluence.
Timezone note: Overnight and RTH sessions are explicitly anchored to America/New_York, so levels stay accurate to the NY session regardless of your chart's display timezone or your own location.
Fully customizable:
SMA lengths (default 50/200)
All line/label colors per timeframe
Session time windows (overnight & RTH)
Label style (left/right) and distance from the last bar
Toggle the opening price line on/off
What it plots:
Daily 50 & 200 SMA — long-term trend anchors
4H 50 & 200 SMA — swing-level bias
1H 50 & 200 SMA — intraday trend filter
Overnight session high/low (Globex, default 18:00–09:30 ET)
Previous day's RTH high/low (default 09:30–16:00 ET, New York session)
Session opening price (RTH open)
All levels are drawn as full-width horizontal lines with a colored price label tagged at the current level, so you always know exactly where each level sits relative to price — no hunting through
multiple timeframes manually.
Why it's useful:
Instead of flipping between daily/4H/1H charts to track moving averages, or manually marking overnight and prior-day highs/lows every session, this indicator pulls everything into one view on your working timeframe. Great for ORB, fib confluence, or KPL-based strategies that lean on higher-timeframe SMA + session level confluence.
Timezone note: Overnight and RTH sessions are explicitly anchored to America/New_York, so levels stay accurate to the NY session regardless of your chart's display timezone or your own location.
Fully customizable:
SMA lengths (default 50/200)
All line/label colors per timeframe
Session time windows (overnight & RTH)
Label style (left/right) and distance from the last bar
Toggle the opening price line on/off
Phát hành các Ghi chú
Add garbage collection and set max_bars_back=5000 to allocate enough memory to prevent memory leaks.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.