OPEN-SOURCE SCRIPT
Session Levels

Plots the High/Low of the three major sessions, the previous FULL trading day's High/Low, the all-time high, and fires sweep alerts when price takes out any of these levels.
ROLLING WINDOW:
// Each session shows only the CURRENT trading day's level plus the previous
// trading day's level -- never older -- so old session lines stop piling up
// and crossing each other.
//
// WEEKLY RESET:
// A trading day starts at 18:00 ET (CME open / Asia open). At the Sunday
// 18:00 ET weekly open every session line is wiped for a clean week.
//
// HOLIDAY AWARENESS:
// The previous-day references (PDH/PDL, the rolling session "previous day",
// and the Monday RTH/Post-market refs) skip US market holidays AND early-close
// half-days (Juneteenth, July 3, Black Friday, Christmas Eve...) and pull from
// the most recent FULL session instead. Holidays are computed algorithmically
// (incl. Good Friday via computus and the NYSE Sat->Fri / Sun->Mon observed
// rules), so there is no yearly list to maintain. Example: the Mon after a
// Juneteenth Friday references Thursday.
// PDH/PDL use a CALENDAR-day (midnight) boundary by default so the prior
// evening's overnight move is NOT lumped into the day -- switch to "RTH only"
// in the inputs if you prefer the cash-session high/low. They draw as a single
// line spanning only the live reference, not a step across all history.
//
// MONDAY REFERENCES:
// Monday's "previous day" is the weekend, so it shows the last full day's
// RTH High/Low and Post-market High/Low for context. These clear Mon evening.
//
// SWEEP ALERTS (new):
// Alert conditions fire when price sweeps a session High/Low (after that
// session closes), the PDH/PDL, or makes a new all-time high.
ROLLING WINDOW:
// Each session shows only the CURRENT trading day's level plus the previous
// trading day's level -- never older -- so old session lines stop piling up
// and crossing each other.
//
// WEEKLY RESET:
// A trading day starts at 18:00 ET (CME open / Asia open). At the Sunday
// 18:00 ET weekly open every session line is wiped for a clean week.
//
// HOLIDAY AWARENESS:
// The previous-day references (PDH/PDL, the rolling session "previous day",
// and the Monday RTH/Post-market refs) skip US market holidays AND early-close
// half-days (Juneteenth, July 3, Black Friday, Christmas Eve...) and pull from
// the most recent FULL session instead. Holidays are computed algorithmically
// (incl. Good Friday via computus and the NYSE Sat->Fri / Sun->Mon observed
// rules), so there is no yearly list to maintain. Example: the Mon after a
// Juneteenth Friday references Thursday.
// PDH/PDL use a CALENDAR-day (midnight) boundary by default so the prior
// evening's overnight move is NOT lumped into the day -- switch to "RTH only"
// in the inputs if you prefer the cash-session high/low. They draw as a single
// line spanning only the live reference, not a step across all history.
//
// MONDAY REFERENCES:
// Monday's "previous day" is the weekend, so it shows the last full day's
// RTH High/Low and Post-market High/Low for context. These clear Mon evening.
//
// SWEEP ALERTS (new):
// Alert conditions fire when price sweeps a session High/Low (after that
// session closes), the PDH/PDL, or makes a new all-time high.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。