PROTECTED SOURCE SCRIPT

Smart Chart Patterns: Breakout Boxes

11
## Abstract
This script is an algorithmic pattern recognition tool designed to identify, validate, and trade classical reversal structures (Double/Triple Tops and Bottoms). Unlike subjective drawing tools, this indicator employs a quantitative approach to geometry. It utilizes Volatility Normalization to ensure that angle detection works consistently across all asset classes—from high-priced assets like Bitcoin to low-volatility Forex pairs—without requiring manual recalibration.

## Methodology & Features

1. Pivot Chaining & Integrity Checks The algorithm identifies Swing Highs and Swing Lows (Pivots). It then "chains" them together to form resistance or support barriers.

Integrity Check: The script strictly enforces that price action between pivots must not violate the connecting line. If price cuts through the line, the pattern is invalidated immediately.

2. Angled vs. Horizontal Structures

Angled Mode: Allows for "channel-like" tops and bottoms (e.g., Rising Wedges or Descending Channels) up to a user-defined volatility-adjusted angle.

Horizontal Mode: If angled lines are disabled, the script applies a strict 1-degree tolerance filter, identifying only classical "Flat" Double/Triple patterns.

3. Trend Filtering To reduce false positives in ranging markets, the script includes a directional filter:

Double Tops are only validated if preceded by a quantitative Uptrend.
Double Bottoms are only validated if preceded by a quantitative Downtrend.
Trend Strength is measured by the net price displacement relative to ATR over a lookback period.

4. Automated Risk Management Upon pattern confirmation (breakout), the script automatically projects:

Target (Green): Projected based on the vertical height of the pattern (Pivot to Neckline).
Stop Loss (Red): Calculated dynamically using the Neckline ± (1.5 * ATR), adapting to current market volatility.

## Settings Guide

Min Touches: Set to 2 for Double patterns, 3 for Triple patterns.
Trend Filter: Enable to ensure the pattern is reversing an existing trend.
Angle Control: Adjusts the maximum allowed slope. Because this is normalized, 15.0 is a robust default for almost all assets.
Targets & Stops: Toggles the automated SL/TP lines and adjusts their multipliers.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.