Trendline Breakout with Volume Confirmation [Dots3Red]Financial markets generally move in trends or sideways ranges.
The core idea of this indicator is to detect bearish trendline channels and highlight potential breakout events.
How it Works
This indicator automatically detects descending trendline channels by dynamically analyzing pivot highs. Consecutive descending pivots are used to form bearish trendlines, which are then extended forward as the market evolves.
Once a valid trendline or channel is detected, the script continuously monitors its status. When price breaks above the upper boundary of the descending trendline/channel, the breakout is detected and the completed structure is drawn on the chart together with a visual breakout label.
A breakout is considered valid when the closing price exceeds the upper boundary of the trendline by a configurable percentage ( Breakout %) .
When a valid trendline is detected on real-time bars but has not yet been broken, the indicator will project the channel forward into the future to help visualize potential breakout zones.
Visual Styles
The indicator provides two visualization modes:
Channel (default) – Displays the full channel area between the trendline and its lower boundary.
Polygon – Displays the detected structure as a polygon, which can make overlapping structures easier to distinguish.
Volume Confirmation
The indicator can optionally display volume confirmation during breakout events.
When enabled, a normalized volume bar is drawn near the breakout location to indicate the relative strength of the breakout based on volume activity.
Settings
Boolean Options
Channel / Polygon Display – Choose how the detected structure is visualized.
Show Volume Breakout Bar – Enables or disables volume confirmation visualization.
Numerical Parameters
Breakout % – Minimum percentage the closing price must exceed the trendline to confirm a breakout.
Slope Factor – Controls how steep the detected trendline must be.
Pivot Length – Number of bars to the left and right used to determine pivot points.
Volume % Breakout – Minimum relative volume required to display a breakout volume bar.
Why Use Polygon Mode?
When multiple channels appear close to each other, the chart may become visually crowded. In such situations, the polygon mode can provide a clearer representation of overlapping structures.
For example, in the chart above for Palantir Technologies during the summer of 2023, two separate trendlines were detected in June and August. Their baselines were very similar, which resulted in channels having almost identical lows. Switching to polygon mode makes the structure easier to interpret.
Example:
Pine Script® indicator






















