OPEN-SOURCE SCRIPT
已更新 $ - HTF Sweeps & PO3

HTF Sweeps & PO3 Indicator
The HTF Sweeps & PO3 indicator is a powerful tool designed for traders to visualise higher timeframe (HTF) candles, identify liquidity sweeps, and track key price levels on a lower timeframe (LTF) chart. Built for TradingView using Pine Script v6, it overlays HTF candle data and highlights significant price movements, such as sweeps of previous highs or lows, to help traders identify potential liquidity sweep and reversal points. The indicator is highly customisable, offering a range of visual and alert options to suit various trading strategies.
Features
- Displays up to three user-defined HTF candles (e.g., 15m, 1H, 4H) overlaid on the LTF chart.
- Customisable candle appearance with adjustable size (Tiny to Huge), offset, spacing, and colours for bullish/bearish candles and wicks.
- Option to show timeframe labels above or below HTF candles with configurable size and position.
- Identifies bullish and bearish sweeps when price moves beyond the high or low of a previous HTF candle and meets specific conditions.
- Displays sweeps on both LTF and HTF with customisable line styles (Solid, Dashed, Dotted), widths, and colours.
- Option to show only the most recent sweep per candle to reduce chart clutter.
- Detects and visualises invalidated sweeps (when price moves past a sweep level in the opposite direction).
- Configurable display for invalidated sweeps on LTF and HTF with distinct line styles and colours.
- Plots horizontal lines at the high and low of the previous HTF candle, extending on both LTF and HTF.
- Customisable line style, width, and color for easy identification of key levels.
- Real-Time Sweep Detection:
-Optional real-time sweep visualisation for active candles, enabling traders to monitor developing price action.
- Triggers alerts for sweep formation (when a new sweep is detected).
- Triggers alerts for sweep invalidation (when a sweep is no longer valid).
- Alerts include details such as timeframe, ticker, and price level for precise notifications.
- Efficiently manages resources with configurable limits for lines, labels, boxes, and bars (up to 500 each).
- Cleans up outdated visual elements to maintain chart clarity.
- Supports multiple timeframes for HTF candles with user-defined settings for visibility and number of candles displayed (1–60).
- Toggle visibility for HTF candles, sweeps, invalidated sweeps, and high/low lines independently for LTF and HTF.
This indicator is ideal for traders focusing on liquidity hunting, order block analysis, or price action strategies, providing clear visual cues and alerts to enhance decision-making.
The HTF Sweeps & PO3 indicator is a powerful tool designed for traders to visualise higher timeframe (HTF) candles, identify liquidity sweeps, and track key price levels on a lower timeframe (LTF) chart. Built for TradingView using Pine Script v6, it overlays HTF candle data and highlights significant price movements, such as sweeps of previous highs or lows, to help traders identify potential liquidity sweep and reversal points. The indicator is highly customisable, offering a range of visual and alert options to suit various trading strategies.
Features
- Higher Timeframe (HTF) Candle Visualisation:
- Displays up to three user-defined HTF candles (e.g., 15m, 1H, 4H) overlaid on the LTF chart.
- Customisable candle appearance with adjustable size (Tiny to Huge), offset, spacing, and colours for bullish/bearish candles and wicks.
- Option to show timeframe labels above or below HTF candles with configurable size and position.
- Liquidity Sweep Detection:
- Identifies bullish and bearish sweeps when price moves beyond the high or low of a previous HTF candle and meets specific conditions.
- Displays sweeps on both LTF and HTF with customisable line styles (Solid, Dashed, Dotted), widths, and colours.
- Option to show only the most recent sweep per candle to reduce chart clutter.
- Invalidated Sweep Tracking:
- Detects and visualises invalidated sweeps (when price moves past a sweep level in the opposite direction).
- Configurable display for invalidated sweeps on LTF and HTF with distinct line styles and colours.
- Previous High/Low Lines:
- Plots horizontal lines at the high and low of the previous HTF candle, extending on both LTF and HTF.
- Customisable line style, width, and color for easy identification of key levels.
- Real-Time Sweep Detection:
-Optional real-time sweep visualisation for active candles, enabling traders to monitor developing price action.
- Alert System:
- Triggers alerts for sweep formation (when a new sweep is detected).
- Triggers alerts for sweep invalidation (when a sweep is no longer valid).
- Alerts include details such as timeframe, ticker, and price level for precise notifications.
- Performance Optimisation:
- Efficiently manages resources with configurable limits for lines, labels, boxes, and bars (up to 500 each).
- Cleans up outdated visual elements to maintain chart clarity.
- Flexible Configuration:
- Supports multiple timeframes for HTF candles with user-defined settings for visibility and number of candles displayed (1–60).
- Toggle visibility for HTF candles, sweeps, invalidated sweeps, and high/low lines independently for LTF and HTF.
This indicator is ideal for traders focusing on liquidity hunting, order block analysis, or price action strategies, providing clear visual cues and alerts to enhance decision-making.
版本注释
Changelog+ Tidied the settings
+ Customisation options for each HTF
+ Stop line at crossover
+ Ability to show & hide certain lines on LTF + HTF
+ Alert Function for Previous HTF H/L
- Removed Sweep Invalidation Alert Function (it wasn't as useful as the new alert function)
- Removed 2x HTF Options to Eliminate Clutter
Tidied the settings
I have ensured the settings page is as clean as possible with added Tooltips to explain various settings.
Customisation options for each HTF
Originally, the customisation options were applied to all lines / candles which restricted the user if you would prefer to customise the settings for individual HTF's / lines.
I have now implemented specific customisation options for each of the toggleable HTF's.
Stop line at crossover
By default, the LTF lines are drawn through price and remain in-line with the current candle on the chart. I have now implemented a new toggle labelled 'X' which will stop the line from being drawn at the exact candle that crosses this level. This is to keep the analysis clean on the chart.
Ability to show & hide certain lines on LTF + HTF
The user now has the option to Enable/Disable specific lines on the LTF & HTF candles. This is also customisable for each toggleable HTF group.
Alert Function for Previous HTF H/L
- Ensure the alert you want to Enable is toggled on the settings menu.
- Create a new alert and select the indicator under the 'Condition' section.
- Ensure the expiry date is in the future.
- This will automatically sent alerts as price develops, automating the alert process and allowing the user to walk away from the charts until the relevant criteria is met for a potential setup. (trade away from the sweep of the previous HTF candle)
版本注释
Changelog+ Show Sweeps on Main Chart
+ Show Unconfirmed Sweeps
+ Session Restriction for Alerts
+ Shared Candle Colours Across HTFs
+ Updated Alert Messages
+ Stop Sweep at HTF Crossover
Show Sweeps on Main Chart
Display LTF sweep lines on the chart even when the current timeframe equals the HTF timeframe, without rendering HTF candles. This allows the user to clearly see sweeps when on the 1h/4h timeframe etc.
Show Unconfirmed Sweeps
Added global input show_unconfirmed_sweeps to optionally display sweep lines before the HTF candle fully closes and confirms (previously hidden behind htf_sweeps_real_time_sweep_show, now explicitly controllable and integrated into plotting logic).
Session Restriction for Alerts
Added input htf_sweeps_session_restriction with options ("London Session Only", "New York Session Only", "London + New York", "Disabled") to limit alerts to specific trading sessions (using UTC-4 timings: London 02:00-05:00, NY 07:00-11:00).
Shared Candle Colours Across HTFs
Moved bull/bear body and wick/border colours to global inputs in "General Settings" (bull_color, bear_color, bull_wick_border_color, bear_wick_border_color), applied uniformly to all HTF candles instead of per-HTF customisation.
Updated Alert Messages
The messages that show on the alert are now cleaner and easier to read.
Stop Sweep at HTF Crossover
The sweep lines on the HTF candles were originally drawn a few candle ahead of price, right on the x axis. I have now made the lines stop at the candle that swept to keep the HTF candles clean.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。