OPEN-SOURCE SCRIPT
Week high / Week low (Mo–Fr)

The indicator tracks the weekly high and low levels of the market starting from Monday 00:00 and updates them throughout the week until Friday. It draws horizontal lines across the chart representing:
Weekly High
Weekly Low
Each level also displays a label that can be positioned in different ways depending on user settings.
🧠 How it works step-by-step
1. Every Monday a new week starts
When a new week begins:
The script stores the current candle’s high as the initial weekHigh
And the current candle’s low as weekLow
Previous week's lines and labels are deleted
New horizontal lines are created and extended to the right
Labels (for high & low) are placed initially at the start of the week
2. During Monday–Friday
On every candle:
If a new higher price is reached → weekly high updates
If a new lower price is reached → weekly low updates
The horizontal line moves to the new value
A saved index remembers where that high/low was created
3. Label Position Control
The user can choose how labels should be anchored:
Mode Meaning
Update point Label stays where the high/low occurred
Right edge Label always moves to the current bar (right end of week)
Right offset Like Right edge but shifted further right by X bars
You can also customize:
label background color
label text color
label size
whether the label points up/down (above or below the line)
line color, style, and width
4. Weekend behavior
On Saturday, the script stops extending the lines, effectively freezing the weekly high and low for that completed week.
Summary
This indicator is useful for traders who want automatic weekly levels, visually clean chart structure, and customizable label placement. It tracks market structure weekly, keeps levels persistent across the chart, and lets you choose exactly how those levels appear.
If you want, I can also create:
✔ previous week high/low
✔ midline (50% of the range)
✔ alerts when price breaks the weekly high/low
✔ highlight liquidity sweeps
Weekly High
Weekly Low
Each level also displays a label that can be positioned in different ways depending on user settings.
🧠 How it works step-by-step
1. Every Monday a new week starts
When a new week begins:
The script stores the current candle’s high as the initial weekHigh
And the current candle’s low as weekLow
Previous week's lines and labels are deleted
New horizontal lines are created and extended to the right
Labels (for high & low) are placed initially at the start of the week
2. During Monday–Friday
On every candle:
If a new higher price is reached → weekly high updates
If a new lower price is reached → weekly low updates
The horizontal line moves to the new value
A saved index remembers where that high/low was created
3. Label Position Control
The user can choose how labels should be anchored:
Mode Meaning
Update point Label stays where the high/low occurred
Right edge Label always moves to the current bar (right end of week)
Right offset Like Right edge but shifted further right by X bars
You can also customize:
label background color
label text color
label size
whether the label points up/down (above or below the line)
line color, style, and width
4. Weekend behavior
On Saturday, the script stops extending the lines, effectively freezing the weekly high and low for that completed week.
Summary
This indicator is useful for traders who want automatic weekly levels, visually clean chart structure, and customizable label placement. It tracks market structure weekly, keeps levels persistent across the chart, and lets you choose exactly how those levels appear.
If you want, I can also create:
✔ previous week high/low
✔ midline (50% of the range)
✔ alerts when price breaks the weekly high/low
✔ highlight liquidity sweeps
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.