OPEN-SOURCE SCRIPT
تم تحديثه

Previous Day's Close Indicator (Regular Hours)

469
This indicator was developed to replace TradingView's built-in previous close indicator—which erroneously uses the close from two trading days prior. By capturing the actual last trade during the standard session, this script provides a reliable and precise previous close level.

Key features include:

Accurate Previous Close: This indicator locks in the last trade of the regular session, ensuring you always see the true previous day close.

Customizable Display Options: Users can choose between a line or circle plot, with adjustable size settings to suit their charting preferences.

Enjoy!
ملاحظات الأخبار
Previous Close Indicator – Updated Version

This script plots the previous regular trading hours (RTH) close on the chart, providing traders with a key reference point for market analysis. The previous close is a widely used support/resistance level, often influencing price action in the following session.

🔹 How It Works:
Session Detection:
The script identifies whether the current time falls within regular trading hours (RTH): Monday to Friday from 09:30 to 16:00 (Eastern Time).
Tracking the Last RTH Close:
While inside RTH, the script continuously updates the last known close price.
When RTH ends, this final close price is stored as the previous close.
Plotting the Previous Close:
The script plots the stored value as a purple circle marker, ensuring clarity on the chart.

🔄 What’s New in This Update?
Optimized Logic: The script now efficiently tracks and stores the last RTH close, ensuring accuracy.
Simplified Code: The new version removes unnecessary conditions and variables, improving performance.
Trading Days Adjusted: Now correctly detects market sessions from Monday to Friday (day codes 2-6).

✅ How to Use It:
Important: Under Chart Settings, Symbol -> Session must be set to Extended Trading Hours for the indicator to work.

This indicator is ideal for traders who monitor gap behavior, overnight sentiment, or price reactions to the previous close.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.