OPEN-SOURCE SCRIPT
Diupdate YH / YL / YC (Live) - Improved

This is an enhanced version of the original **“YH / YL / YC (Live)”** script by **Ilse Filippo** (`Ilse_Filippo` on TradingView).
The indicator automatically plots the previous completed trading session’s:
* **YH** — Yesterday High
* **YL** — Yesterday Low
* **YC** — Yesterday Close
It supports stocks, ADRs, ETFs, indices, futures, forex, and metals.
### Improvements in v1.2
* Migrated to **Pine Script v6**
* Added weekend-aware handling so **Friday’s YH / YL / YC are already available on Saturday and Sunday**
* Friday remains the reference while Monday’s session is still active
* Replaced the original manual stock RTH tracking with TradingView’s native **regular-session data**
* Fixed missing **YH / YL** levels on stock charts
* Stocks, ADRs, and ETFs now use their exchange-defined regular trading session
* Preserved the original line and label presentation
### Credits
Original script: **YH / YL / YC (Live)**
Original author: **Ilse Filippo**
TradingView: **Ilse_Filippo**
This modified version retains the open-source distribution model of the original script.
The indicator automatically plots the previous completed trading session’s:
* **YH** — Yesterday High
* **YL** — Yesterday Low
* **YC** — Yesterday Close
It supports stocks, ADRs, ETFs, indices, futures, forex, and metals.
### Improvements in v1.2
* Migrated to **Pine Script v6**
* Added weekend-aware handling so **Friday’s YH / YL / YC are already available on Saturday and Sunday**
* Friday remains the reference while Monday’s session is still active
* Replaced the original manual stock RTH tracking with TradingView’s native **regular-session data**
* Fixed missing **YH / YL** levels on stock charts
* Stocks, ADRs, and ETFs now use their exchange-defined regular trading session
* Preserved the original line and label presentation
### Credits
Original script: **YH / YL / YC (Live)**
Original author: **Ilse Filippo**
TradingView: **Ilse_Filippo**
This modified version retains the open-source distribution model of the original script.
Catatan Rilis
// REVISION HISTORY// v1.1 - 2026-08-23
// - Migrated to Pine Script v6.
// - Added completed-daily-bar detection for weekend handling.
// - Preserved the original stock RTH handling and drawing logic.
//
// v1.2 - 2026-09-26
// - Corrected the weekend/closed-session daily-source logic for indices/futures.
// - Current daily OHLC is requested with lookahead_on, while time_close/timenow
// explicitly gates whether the current daily bar is allowed to become YH/YL/YC.
// - During an active daily session, YH/YL/YC still use the previous completed day.
// - After the daily session closes, the just-completed day becomes the reference,
// so Friday remains visible on Saturday/Sunday and into Monday before Monday closes.
// - Updated default YH/YL/YC colors to the user's current chart defaults.
// - No changes to stock RTH tracking, line placement, or label placement.
//
// v1.3 - 2026-09-26
// - Added optional price display to YH / YL / YC labels.
// - Added "Show Price in Labels" configuration option.
// - Label format uses one space between level name and price.
// - Prices below 10,000 are displayed with maximum 1 decimal.
// - Prices at or above 10,000 are rounded to integer.
// - Increased default label offset from 15 to 45 bars.
// - No changes to YH/YL/YC source logic, weekend handling, or line placement.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.