OPEN-SOURCE SCRIPT
Previous Day & Week High/Low DangNP

The "Previous Day & Week High/Low" indicator is a simple yet powerful price action tool designed for day traders and swing traders. It automatically identifies and plots the highest and lowest price levels of the previous trading day and the previous trading week directly onto your chart, saving you the time of drawing them manually.
Key Features
Previous Day Levels (Blue Lines): Automatically plots the Previous Day High (PDH) and Previous Day Low (PDL). These lines are configured to display only on intraday timeframes to keep your higher timeframe charts clean.
Previous Week Levels (Purple Lines): Plots the Previous Week High (PWH) and Previous Week Low (PWL). These are visible on both intraday and daily timeframes.
Fully Customizable: You can easily toggle the visibility of either the Daily or Weekly levels on and off via the indicator's Inputs settings.
How to Use
Previous Day and Previous Week highs and lows are crucial structural levels in price action trading:
Support & Resistance: These levels often act as natural barriers where price might stall, consolidate, or reverse.
Liquidity Sweeps (False Breakouts): Institutional traders often hunt the liquidity resting above previous highs or below previous lows. Traders can look for price to "sweep" these levels and reject them as a strong reversal signal.
Breakouts: A strong, sustained break and candle close beyond the previous day or week's extremes can signal trend continuation.
This script is lightweight, distraction-free, and written in Pine Script v6 for optimal performance.
Key Features
Previous Day Levels (Blue Lines): Automatically plots the Previous Day High (PDH) and Previous Day Low (PDL). These lines are configured to display only on intraday timeframes to keep your higher timeframe charts clean.
Previous Week Levels (Purple Lines): Plots the Previous Week High (PWH) and Previous Week Low (PWL). These are visible on both intraday and daily timeframes.
Fully Customizable: You can easily toggle the visibility of either the Daily or Weekly levels on and off via the indicator's Inputs settings.
How to Use
Previous Day and Previous Week highs and lows are crucial structural levels in price action trading:
Support & Resistance: These levels often act as natural barriers where price might stall, consolidate, or reverse.
Liquidity Sweeps (False Breakouts): Institutional traders often hunt the liquidity resting above previous highs or below previous lows. Traders can look for price to "sweep" these levels and reject them as a strong reversal signal.
Breakouts: A strong, sustained break and candle close beyond the previous day or week's extremes can signal trend continuation.
This script is lightweight, distraction-free, and written in Pine Script v6 for optimal performance.
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.