OPEN-SOURCE SCRIPT
Updated Pivot and Wick Boxes with Break Signals

█ OVERVIEW
This Pine Script® indicator draws support and resistance levels based on high and low pivot points and the wicks of pivot candles. When the price breaks these levels, breakout signals are generated, with an optional volume filter for greater precision. The indicator is fully customizable, allowing users to adjust box styles, pivot length, and signal settings.
█ CONCEPTS
The indicator relies on several key elements to identify and visualize important price levels and trading signals:
Pivot Identification
High and low pivots are detected using the ta.pivothigh and ta.pivotlow functions with a configurable pivot length. Boxes are drawn based on the pivot level and the wick of the pivot candle (top for high pivots, bottom for low pivots).
List of Features
1 — High and Low Pivot Boxes: The indicator draws boxes based on high pivot candles (red) and low pivot candles (green) and their wicks, with options to customize colors, border styles, and background gradient. Boxes are limited to 500 bars back, meaning support and resistance levels older than 500 candles are not displayed to maintain chart clarity.
2 — Breakout Signals: When the price closes above the upper edge of a high pivot box, a breakout signal is generated (green triangle below the bar). When the price closes below the lower edge of a low pivot box, a breakout signal is generated (red triangle above the bar).
Signals can be filtered using volume, requiring the volume at the breakout to exceed the average volume multiplied by a configurable multiplier.
3 — Box Management: The indicator limits the number of displayed boxes (default is 15 for high pivots and 15 for low pivots), removing the oldest boxes when the limit is reached. Boxes older than 500 bars are automatically removed.
Volume Filtering
An optional volume filter allows users to require breakout signals to be confirmed by volume exceeding the moving average of volume (calculated over a selected period, default is 20 days).
█ OTHER SECTIONS
FEATURES
• Show High/Low Pivot Boxes: Enables or disables the display of boxes for high and low pivots.
• Pivot Length: Specifies the number of bars back and forward for detecting pivots (default is 5).
• Max Boxes: Sets the maximum number of boxes for high and low pivots (default is 15).
• Volume Filter: Enables a volume filter for breakout signals, with a configurable multiplier and average period.
• Box Style: Allows customization of border color, background gradient, border width, and border style (solid, dashed, dotted).
HOW TO USE
1 — Add the indicator to your TradingView chart by selecting “Pivot and Wick Boxes with Break Signals” from the indicators list.
2 — Configure the settings in the indicator’s dialog window, adjusting pivot length, maximum number of boxes, colors, and style.
3 — Enable the volume filter if you want signals to be confirmed by high volume.
4 — Monitor breakout signals (green triangles below bars for upward breakouts, red triangles above bars for downward breakouts) on the chart.
LIMITATIONS
• New pivots are detected with a delay equal to the set pivot length. A lower pivot length value results in faster pivot detection but produces pivots with less significance as support or resistance levels compared to those generated with a longer value.
• Breakout signals may produce false signals in volatile market conditions, especially without the volume filter.
• Boxes are limited to 500 bars back, which may exclude older pivots on long-term charts.
This Pine Script® indicator draws support and resistance levels based on high and low pivot points and the wicks of pivot candles. When the price breaks these levels, breakout signals are generated, with an optional volume filter for greater precision. The indicator is fully customizable, allowing users to adjust box styles, pivot length, and signal settings.
█ CONCEPTS
The indicator relies on several key elements to identify and visualize important price levels and trading signals:
Pivot Identification
High and low pivots are detected using the ta.pivothigh and ta.pivotlow functions with a configurable pivot length. Boxes are drawn based on the pivot level and the wick of the pivot candle (top for high pivots, bottom for low pivots).
List of Features
1 — High and Low Pivot Boxes: The indicator draws boxes based on high pivot candles (red) and low pivot candles (green) and their wicks, with options to customize colors, border styles, and background gradient. Boxes are limited to 500 bars back, meaning support and resistance levels older than 500 candles are not displayed to maintain chart clarity.
2 — Breakout Signals: When the price closes above the upper edge of a high pivot box, a breakout signal is generated (green triangle below the bar). When the price closes below the lower edge of a low pivot box, a breakout signal is generated (red triangle above the bar).
Signals can be filtered using volume, requiring the volume at the breakout to exceed the average volume multiplied by a configurable multiplier.
3 — Box Management: The indicator limits the number of displayed boxes (default is 15 for high pivots and 15 for low pivots), removing the oldest boxes when the limit is reached. Boxes older than 500 bars are automatically removed.
Volume Filtering
An optional volume filter allows users to require breakout signals to be confirmed by volume exceeding the moving average of volume (calculated over a selected period, default is 20 days).
█ OTHER SECTIONS
FEATURES
• Show High/Low Pivot Boxes: Enables or disables the display of boxes for high and low pivots.
• Pivot Length: Specifies the number of bars back and forward for detecting pivots (default is 5).
• Max Boxes: Sets the maximum number of boxes for high and low pivots (default is 15).
• Volume Filter: Enables a volume filter for breakout signals, with a configurable multiplier and average period.
• Box Style: Allows customization of border color, background gradient, border width, and border style (solid, dashed, dotted).
HOW TO USE
1 — Add the indicator to your TradingView chart by selecting “Pivot and Wick Boxes with Break Signals” from the indicators list.
2 — Configure the settings in the indicator’s dialog window, adjusting pivot length, maximum number of boxes, colors, and style.
3 — Enable the volume filter if you want signals to be confirmed by high volume.
4 — Monitor breakout signals (green triangles below bars for upward breakouts, red triangles above bars for downward breakouts) on the chart.
LIMITATIONS
• New pivots are detected with a delay equal to the set pivot length. A lower pivot length value results in faster pivot detection but produces pivots with less significance as support or resistance levels compared to those generated with a longer value.
• Breakout signals may produce false signals in volatile market conditions, especially without the volume filter.
• Boxes are limited to 500 bars back, which may exclude older pivots on long-term charts.
Release Notes
Update: Added labels for active pivots (those that haven’t been broken yet). The labels display the price level, volume, and volume change in percent (delta). Delta compares the volume at the pivot to the average volume from recent candles (the number of candles can be adjusted). Labels are removed when the level is broken or after 500 bars.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.