Harmonic PatternInstitutional Harmonic
PRZ Lifecycle Scanner is a harmonic pattern and price structure indicator designed to identify confirmed pivot formations, Potential Reversal Zones, pattern lifecycle states, invalidation levels, and ATR-based risk projection areas.
The indicator is built for structured chart reading. It does not predict future price movement, does not execute trades, and does not guarantee results. Its purpose is to help traders study harmonic geometry, PRZ reactions, market structure, volatility context, and risk areas in a clear visual framework.
────────────────────────────
MAIN CONCEPT
────────────────────────────
Harmonic trading is based on the relationship between price legs. A valid pattern is not only a drawing on the chart. It requires measured ratios, a defined completion area, and a clear invalidation zone.
This indicator uses confirmed pivots to build X-A-B-C-D structures and other market patterns. When a valid structure is detected, the script calculates a Potential Reversal Zone using ratio confluence and then follows the pattern through different lifecycle states.
The main idea is simple:
1. Detect a confirmed structure.
2. Measure the ratios.
3. Build the PRZ.
4. Wait for price interaction with the PRZ.
5. Track reaction, invalidation, or target progression.
────────────────────────────
WHAT THE INDICATOR CAN DISPLAY
────────────────────────────
The script can display:
* Harmonic X-A-B-C-D structures
* Potential Reversal Zones
* Pattern labels
* Pattern score
* Bullish or bearish direction
* Entry reference
* Invalidation level
* Stop area
* TP1, TP2, and TP3 projection levels
* TP zones
* Pattern lifecycle status
* Dashboard information
* Higher timeframe bias
* Volatility context
* Alert events
────────────────────────────
PATTERN LIFECYCLE
────────────────────────────
Each pattern can move through several states:
DETECTED
A valid structure has been found and measured.
PRZ TOUCHED
Price has reached the Potential Reversal Zone.
REACTION
A rejection or reaction condition has appeared after price interacts with the PRZ.
TP1 HIT
The first projected target has been reached.
TP2 HIT
The second projected target has been reached.
TP3 HIT
The third projected target has been reached.
FAILED
Price has moved beyond the invalidation area.
EXPIRED
The pattern remained active for too many bars without developing.
This lifecycle approach is designed to separate raw pattern detection from cleaner trading context.
────────────────────────────
PATTERNS INCLUDED
────────────────────────────
The indicator can detect several harmonic and structural formations, depending on the active settings:
* Gartley
* Bat
* Alternate Bat
* Butterfly
* Crab
* Deep Crab
* Cypher
* 5-0
* AB=CD
* Three Drives
* Double Top
* Double Bottom
* Triple Top
* Triple Bottom
* Head and Shoulders
* Inverse Head and Shoulders
* Triangle
* Wedge
Each pattern type can be enabled or disabled from the settings.
────────────────────────────
INPUTS EXPLAINED
────────────────────────────
ENGINE SETTINGS
Pivot Depth
Controls how many bars are used to confirm a pivot high or pivot low. A lower value detects more structures but can create more noise. A higher value detects fewer structures but usually produces cleaner formations.
Ratio Tolerance
Defines how much deviation is allowed around the expected Fibonacci or structural ratio. Lower tolerance is stricter. Higher tolerance allows more patterns.
Minimum XA Size
Filters out very small patterns. This helps avoid structures that are too small compared to current volatility.
Minimum Score
Defines the minimum quality score required before a pattern can be displayed. A higher score means fewer but more selective patterns.
Pattern Expiration Bars
Defines how long an active pattern can remain valid before it is considered expired.
────────────────────────────
PATTERN SETTINGS
Enable Gartley
Turns Gartley pattern detection on or off.
Enable Bat
Turns Bat pattern detection on or off.
Enable Alternate Bat
Turns Alternate Bat pattern detection on or off.
Enable Butterfly
Turns Butterfly pattern detection on or off.
Enable Crab
Turns Crab pattern detection on or off.
Enable Deep Crab
Turns Deep Crab pattern detection on or off.
Enable Cypher
Turns Cypher pattern detection on or off.
Enable 5-0
Turns 5-0 pattern detection on or off.
Enable AB=CD
Turns AB=CD pattern detection on or off.
Enable Three Drives
Turns Three Drives detection on or off.
Enable Double Top / Bottom
Turns Double Top and Double Bottom detection on or off.
Enable Triple Top / Bottom
Turns Triple Top and Triple Bottom detection on or off.
Enable Head and Shoulders
Turns Head and Shoulders detection on or off.
Enable Inverse Head and Shoulders
Turns Inverse Head and Shoulders detection on or off.
Enable Triangle
Turns triangle structure detection on or off.
Enable Wedge
Turns wedge structure detection on or off.
────────────────────────────
PRZ SETTINGS
Show Institutional PRZ
Shows or hides the Potential Reversal Zone.
Auto-Extend PRZ Only
Extends active PRZ zones automatically as new bars appear.
Max Active PRZ Zones
Limits how many PRZ zones can stay visible on the chart.
PRZ Width / Confluence Sensitivity
Controls how tight or wide the PRZ can be around the calculated confluence area. A tighter setting is more selective. A wider setting is more visual and easier to see.
Show PRZ Labels
Shows or hides labels linked to the PRZ and pattern state.
────────────────────────────
RISK MODEL SETTINGS
Show Entry / SL / TP
Shows or hides the risk projection model.
Auto-Extend RM Lines / Labels
Extends Entry, SL, TP, and label positions automatically as new bars appear.
Show TP Zones
Shows or hides the colored target zones.
Auto-Extend TP Zones
Extends TP zone backgrounds automatically as new bars appear.
Max Active Risk Models
Limits the number of visible risk models.
Max Active TP Zone Sets
Limits the number of visible TP zone groups.
Level Projection Bars
Controls how far Entry, SL, TP, PRZ, and target zone objects are projected to the right side of the chart.
ATR Stop Multiplier
Controls the distance of the invalidation or stop reference using ATR.
TP1 Multiplier
Controls the first target projection.
TP2 Multiplier
Controls the second target projection.
TP3 Multiplier
Controls the third target projection.
Show TP3
Shows or hides the third target.
────────────────────────────
VISUAL SETTINGS
Show Connectors
Shows or hides the internal pattern connector lines.
Show Pattern Labels
Shows or hides the pattern name labels.
Show Ratio Labels
Shows or hides ratio information on the chart.
Neutral Color Theme
Uses a cleaner chart style with more neutral colors.
Bullish Color
Controls the color used for bullish structures.
Bearish Color
Controls the color used for bearish structures.
PRZ Color
Controls the color used for Potential Reversal Zones.
Risk Color
Controls the color used for invalidation or stop areas.
Target Color
Controls the color used for target zones.
────────────────────────────
DASHBOARD SETTINGS
Show Dashboard
Shows or hides the information panel.
Dashboard Position
Moves the panel to the selected chart corner.
Dashboard Detail Mode
Controls how much information appears inside the dashboard.
The dashboard can show:
* Last detected pattern
* Direction
* Score
* Status
* PRZ range
* Entry reference
* Invalidation level
* TP1, TP2, TP3
* Higher timeframe bias
* ATR regime
* Active PRZ count
* Active risk model count
* Extension status
────────────────────────────
CONTEXT SETTINGS
Use Higher Timeframe Bias
Adds a higher timeframe trend context to the dashboard or scoring logic.
Higher Timeframe
Selects the timeframe used for higher timeframe bias.
HTF EMA Fast
Defines the fast EMA used for higher timeframe trend reading.
HTF EMA Slow
Defines the slow EMA used for higher timeframe trend reading.
Use VWAP Context
Adds VWAP context when available on the chart.
Use ATR Regime
Adds volatility regime information based on ATR behavior.
────────────────────────────
ALERT SETTINGS
Alert New Pattern
Triggers an alert when a new valid pattern is detected. This is useful for scanning, but it should not be treated as a trade entry by itself.
Alert PRZ Touch
Triggers an alert when price reaches the PRZ.
Alert Confirmed Reaction
Triggers an alert when price reacts after interacting with the PRZ.
Alert High Score Only
Filters alerts so that only patterns above a selected score can trigger.
Alert Minimum Score
Sets the minimum score required for high-score alerts.
Alert TP Hits
Triggers alerts when TP1, TP2, or TP3 is reached.
Alert Failed Pattern
Triggers an alert when a pattern is invalidated.
Webhook Alert Mode
Allows dynamic alert messages to be used for automation workflows.
For cleaner alerts, it is generally better to focus on confirmed reaction alerts instead of raw new pattern alerts.
────────────────────────────
MINI TUTORIAL FOR BEGINNERS
────────────────────────────
1. Add the indicator to the chart.
2. Start with default settings.
3. Look for a clean pattern label and PRZ zone.
4. Do not treat a new pattern as an entry by itself. First, wait for price to reach or interact with the PRZ.
5. Check the pattern status:
* DETECTED means the structure exists.
* PRZ TOUCHED means price reached the reaction area.
* REACTION means the script detected a reaction condition.
* FAILED means the setup is invalidated.
* TP1, TP2, or TP3 means projected target areas were reached.
6. Check the dashboard:
* Pattern name
* Direction
* Score
* Status
* PRZ
* Invalidation
* Higher timeframe bias
* Volatility context
7. Compare the setup with your own chart reading:
* Is price near support or resistance?
* Is there liquidity nearby?
* Is the market trending or ranging?
* Is the pattern aligned with the higher timeframe?
* Is the invalidation distance acceptable?
8. Use alerts carefully. For cleaner signals, use confirmed reaction alerts rather than raw detection alerts.
────────────────────────────
EXAMPLE USE CASES
────────────────────────────
Example 1: Bullish harmonic reaction
A bullish harmonic pattern appears near a previous support area. Price enters the PRZ and prints a rejection reaction. The lifecycle status changes from DETECTED to PRZ TOUCHED, then to REACTION. The trader can use the PRZ, invalidation, and target levels as visual references for further analysis.
Example 2: Bearish pattern near resistance
A bearish pattern forms near a previous resistance area. Price reaches the PRZ and fails to continue upward. If a reaction is detected, the dashboard updates the status and shows the bearish context, invalidation level, and projected targets.
Example 3: Pattern invalidation
A pattern is detected, but price moves beyond the invalidation level. The script marks the pattern as FAILED. This helps separate invalidated setups from still-active ones.
Example 4: Scanning mode
A trader can enable alerts for new patterns to monitor multiple charts. In this mode, new pattern alerts are used only as early notifications. A second check is still needed before making any decision.
Example 5: Cleaner alert mode
A trader who wants fewer alerts can disable New Pattern and PRZ Touch alerts, then keep only Confirmed Reaction, TP Hits, and Failed Pattern alerts active.
────────────────────────────
BEST PRACTICES
────────────────────────────
Use lower tolerance for stricter pattern detection.
Use higher pivot depth to reduce noise.
Use the dashboard to confirm the pattern state before focusing on the setup.
Use confirmed reaction alerts for cleaner notifications.
Avoid using the indicator alone. Combine it with market structure, support and resistance, liquidity areas, session context, and personal risk management.
Test the indicator on different symbols and timeframes before relying on it for live decisions.
────────────────────────────
LIMITATIONS
────────────────────────────
This script is an indicator, not a strategy.
It does not place orders.
It does not provide financial advice.
It does not guarantee profitable results.
Patterns can fail.
Alerts depend on the user’s TradingView alert settings.
Pivot-based tools confirm structures after enough bars have passed, so they should be understood as confirmation tools, not instant prediction tools.
Signals may be less reliable during low liquidity, high spread, major news, or highly erratic market conditions.
Pine Script® indicator












