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.
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.