OPEN-SOURCE SCRIPT
Key Levels - By Dukle

KEY LEVELS — current day dH / dO / dL and previous day pdH / pdL
WHAT IT DOES
Draws the five reference levels most day traders check first, as clean horizontal lines with small tags to the right of each line: the current day's Open (dO), High (dH) and Low (dL), plus the previous day's High and Low (pdH, pdL) in a second color.
HOW IT WORKS
The levels are computed directly from the chart's own intraday bars — no higher-timeframe security calls. The day boundary follows the symbol's exchange trading day, the same boundary the built-in daily candles use. dO is fixed at the session open. dH and dL update in real time: the moment price prints a new high or low of the day, the line moves with it — that is by design, since "today's high so far" is a moving value until the session closes. At the daily rollover, the finished day's high and low become the new pdH and pdL, and the current-day lines reset to the new open.
HOW TO USE IT
Works on any intraday timeframe (it deliberately draws nothing on Daily and above, where the current candle already is the day). Typical uses: pdH/pdL as breakout or rejection zones for the session, dO as the intraday bull/bear line, dH/dL as the developing range. All five lines can be toggled individually; colors, line width and how far the lines extend to the right of price are configurable in the settings.
NOTES
The current-day lines updating with new highs/lows is intended behavior, not lookahead — the previous-day levels never change during the session. Nothing here is financial advice.
WHAT IT DOES
Draws the five reference levels most day traders check first, as clean horizontal lines with small tags to the right of each line: the current day's Open (dO), High (dH) and Low (dL), plus the previous day's High and Low (pdH, pdL) in a second color.
HOW IT WORKS
The levels are computed directly from the chart's own intraday bars — no higher-timeframe security calls. The day boundary follows the symbol's exchange trading day, the same boundary the built-in daily candles use. dO is fixed at the session open. dH and dL update in real time: the moment price prints a new high or low of the day, the line moves with it — that is by design, since "today's high so far" is a moving value until the session closes. At the daily rollover, the finished day's high and low become the new pdH and pdL, and the current-day lines reset to the new open.
HOW TO USE IT
Works on any intraday timeframe (it deliberately draws nothing on Daily and above, where the current candle already is the day). Typical uses: pdH/pdL as breakout or rejection zones for the session, dO as the intraday bull/bear line, dH/dL as the developing range. All five lines can be toggled individually; colors, line width and how far the lines extend to the right of price are configurable in the settings.
NOTES
The current-day lines updating with new highs/lows is intended behavior, not lookahead — the previous-day levels never change during the session. Nothing here is financial advice.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.