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
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.