OPEN-SOURCE SCRIPT
DAILY AND WEEKLY MID LINES

DAILY AND WEEKLY MID LINES INDICATOR
Description:
This indicator calculates and visualizes the dynamic midpoint (mid) of the current day and week in real-time. It provides traders with key reference levels based on developing price action.
Features:
Daily Mid Line:
Color: Orange
Thickness: 3 pixels
Style: Solid line
Updates: Automatically recalculates with each new candle
Calculation: Average of the day's highest high and lowest low from market open
Weekly Mid Line:
Color: Blue
Thickness: 3 pixels
Style: Dashed line
Updates: Continuously recalculates throughout the week
Calculation: Average of the week's highest high and lowest low from week start
How It Works:
At the start of each new trading day (00:00), the daily mid line resets and begins calculating from the first candle
At the start of each new trading week (typically Monday), the weekly mid line resets and begins fresh calculations
Both lines extend automatically to the right as new candles form
The lines are dynamic - they adjust as new highs/lows are made during the day/week
Trading Applications:
Support/Resistance Levels:
The mid lines act as natural equilibrium points where price may find temporary support or resistance
Daily mid can serve as intraday pivot, weekly mid as broader market balance point
Trend Analysis:
Price consistently above mid lines suggests bullish momentum
Price consistently below mid lines suggests bearish momentum
Relationship between daily and weekly mid lines shows multi-timeframe alignment
Entry/Exit Signals:
Price crossing above daily mid may indicate short-term bullish momentum
Price crossing below daily mid may indicate short-term bearish momentum
Weekly mid breaks can signal more significant trend changes
Market Context:
Distance between price and mid lines indicates market extremity
Steeper mid line slopes suggest stronger directional momentum
Flat mid lines suggest range-bound or consolidating markets
Confluence Trading:
Combine with other indicators (RSI, MACD, moving averages) for confirmation
Use as dynamic levels for stop-loss placement or take-profit targets
Best Practices:
More effective on higher timeframes (1H, 4H, Daily) for clearer signals
Works well in trending markets where mid lines act as moving support/resistance
Monitor for price rejection or acceptance at mid levels for trading decisions
Use in conjunction with volume analysis for confirmation
Psychological Significance:
Mid points often represent fair value areas where buyers and sellers find temporary equilibrium, making them natural decision points for market participants.
This indicator is particularly useful for day traders, swing traders, and position traders looking for dynamic, real-time reference points that adapt to current market conditions rather than relying on static historical levels.
Description:
This indicator calculates and visualizes the dynamic midpoint (mid) of the current day and week in real-time. It provides traders with key reference levels based on developing price action.
Features:
Daily Mid Line:
Color: Orange
Thickness: 3 pixels
Style: Solid line
Updates: Automatically recalculates with each new candle
Calculation: Average of the day's highest high and lowest low from market open
Weekly Mid Line:
Color: Blue
Thickness: 3 pixels
Style: Dashed line
Updates: Continuously recalculates throughout the week
Calculation: Average of the week's highest high and lowest low from week start
How It Works:
At the start of each new trading day (00:00), the daily mid line resets and begins calculating from the first candle
At the start of each new trading week (typically Monday), the weekly mid line resets and begins fresh calculations
Both lines extend automatically to the right as new candles form
The lines are dynamic - they adjust as new highs/lows are made during the day/week
Trading Applications:
Support/Resistance Levels:
The mid lines act as natural equilibrium points where price may find temporary support or resistance
Daily mid can serve as intraday pivot, weekly mid as broader market balance point
Trend Analysis:
Price consistently above mid lines suggests bullish momentum
Price consistently below mid lines suggests bearish momentum
Relationship between daily and weekly mid lines shows multi-timeframe alignment
Entry/Exit Signals:
Price crossing above daily mid may indicate short-term bullish momentum
Price crossing below daily mid may indicate short-term bearish momentum
Weekly mid breaks can signal more significant trend changes
Market Context:
Distance between price and mid lines indicates market extremity
Steeper mid line slopes suggest stronger directional momentum
Flat mid lines suggest range-bound or consolidating markets
Confluence Trading:
Combine with other indicators (RSI, MACD, moving averages) for confirmation
Use as dynamic levels for stop-loss placement or take-profit targets
Best Practices:
More effective on higher timeframes (1H, 4H, Daily) for clearer signals
Works well in trending markets where mid lines act as moving support/resistance
Monitor for price rejection or acceptance at mid levels for trading decisions
Use in conjunction with volume analysis for confirmation
Psychological Significance:
Mid points often represent fair value areas where buyers and sellers find temporary equilibrium, making them natural decision points for market participants.
This indicator is particularly useful for day traders, swing traders, and position traders looking for dynamic, real-time reference points that adapt to current market conditions rather than relying on static historical levels.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.