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 อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน