OPEN-SOURCE SCRIPT

Dual Pivot Structure

341
Dual Pivot Structure: Speed vs. Stability [Prototype]
Overview
This script is an experimental prototype designed to solve the most common frustration with Market Structure indicators: The Trade-off between Lag and Noise.

In traditional Price Action analysis, verifying a Pivot High or Low requires waiting for X number of candles to close.

High Lookback (e.g., 5 bars): Reliable structure, but the signal appears too late to trade.

Low Lookback (e.g., 1 bar): Fast signals, but prone to "fake-outs" and noise.

This indicator runs both logic systems simultaneously, allowing traders to see the "True" market structure while receiving "Early Warning" signals for potential entries.

How It Works
The script calculates two parallel layers of market data:

1. The "Structure" Layer (Slow & Reliable)

Uses a standard, higher lookback period (Default: 5 Left / 5 Right).

Purpose: Defines the macro trend. It labels confirmed Higher Highs (HH), Lower Lows (LL), etc.

Visual: Solid colored labels. These confirm the trend bias.

2. The "Signal" Layer (Fast & Actionable)

Uses a rapid, minimal lookback period (Default: 1 Left / 1 Right).

Purpose: Hunts for potential reversals within the macro trend.

Logic: If the Macro Trend is bullish, but price pulls back, this layer looks for a "Micro Pivot" that is higher than the previous Macro Low.

Visual: Orange "⚠ HL?" or "⚠ LH?" text.

How to Use This Script
This tool is best used to time entries within an established trend.

Identify the Trend: Look at the Solid Labels (Green/Red). Are we making HHs and HLs? The trend is Up.

Wait for the Pullback: Allow price to retrace.

Watch for the Early Warning: Look for the orange "⚠ HL?" text.

This appears bars before the structural pivot is confirmed.

The Signal: This is your aggressive entry trigger or alert to watch for a lower timeframe change of character.

Confirmation: If price continues in your direction, the script will eventually print a solid HL label, confirming your early entry was correct.

Settings
Structure Settings: Controls the sensitivity of the main trend (Default: 5/5). Increase this for higher timeframes to filter noise.

Signal Settings: Controls the sensitivity of the early warnings (Default: 1/1). Keep this low for maximum speed.

Visuals: Toggle the "Early Warning" labels on/off and customize colors to fit your chart theme.

Disclaimer
This script is a prototype for educational purposes. The "Early Warning" signals are, by definition, unconfirmed and carry higher risk. Always manage risk accordingly.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.