OPEN-SOURCE SCRIPT

Previous Week High & Low with middle line

Description:
The Previous Week High & Low Indicator is a powerful tool designed to provide traders with key reference levels from the previous trading week. It dynamically calculates and plots the previous week's high, low, and midpoint levels directly on your chart, helping you identify critical support and resistance zones.

Features:
1. **Previous Week High and Low Lines**:
- The indicator displays the high and low prices of the previous trading week, allowing you to analyze price action relative to these levels.
- These lines are plotted as step lines, visible only during the active trading days (Monday to Friday), ensuring clean and uncluttered charts.

2. Midpoint Line:
- The midpoint between the previous week's high and low is calculated and displayed as a reference level.
- This white line can act as a psychological pivot point for market participants.

3. Customizable Display:
- You can toggle the visibility of the high and low lines using input options, tailoring the indicator to your preferences.

4. Precision and Aesthetics:
- The lines are plotted with precision and styled for clarity, using subtle transparency for an unobtrusive yet informative appearance.

Use Case:
- This indicator is ideal for traders who rely on historical price levels for planning entries, exits, or stop-loss placements.
- It works seamlessly with any timeframe and asset, making it versatile for various trading strategies.

How It Works:
- The indicator fetches the previous week's high and low prices using the weekly timeframe and "lookahead" mode to ensure these levels remain static after the week's close.
- The lines are plotted only on weekdays (Monday to Friday) to exclude weekend data, ensuring accuracy for markets that operate 24/5.

This tool simplifies your chart analysis and empowers you to make informed trading decisions based on historical price dynamics.
Bands and ChannelsCyclesPivot points and levels

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer