PROTECTED SOURCE SCRIPT

Swing Structure + High/Low PG/PB Calculation

36
This script detects swing structure using a locked ZigZag: a pivot is confirmed only after price reverses by a user-defined percent or ATR threshold with a minimum bar spacing. It draws the latest swing leg and projects PG (trend extensions) and PB (pullback) levels from the last confirmed pivot. Alerts fire exactly on the bar where a Pivot High or Pivot Low is confirmed. The script does not repaint: pivots are added only after the reversal threshold is met.
Inputs: method (Percent/ATR), percent/ATR settings, minimum bars between pivots, number of swing segments to draw, PG/PB level sets, and alert filters (close-only / realtime).

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.