OPEN-SOURCE SCRIPT
WaveScope

WaveScope is a market structure indicator designed to identify confirmed swing highs and lows, classify them as Higher High (HH), Higher Low (HL), Lower High (LH), or Lower Low (LL), and automatically detect the structural events Break of Structure (BOS) and Change of Character (CHoCH).
Rather than focusing on individual price swings, the algorithm builds a continuous sequence of confirmed structural points using Pivot High and Pivot Low detection. This sequence serves as the foundation for all structural calculations performed by the indicator.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📖 Overview
Most market structure indicators simply connect confirmed pivots.
During strong directional moves this often creates either excessive structural noise or delays the representation of the current market movement until the next pivot has been confirmed.
WaveScope was designed around a different idea.
Instead of treating each pivot as an isolated event, the indicator continuously maintains the latest structural swing.
Until an opposite pivot is confirmed, the most recent structural point can be replaced whenever price creates a stronger extreme of the same type.
At the same time, the developing swing is displayed independently from the confirmed structure and is updated in real time.
This allows traders to observe:
• confirmed market structure;
• the current developing swing;
• BOS and CHoCH events;
• the current structural state through the information panel.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ How It Works
WaveScope uses symmetrical Pivot High and Pivot Low detection with configurable sensitivity.
Every confirmed pivot is compared with the previous confirmed pivot of the same type.
The result determines whether the new structural point is classified as:
• Higher High (HH)
• Higher Low (HL)
• Lower High (LH)
• Lower Low (LL)
Rather than measuring absolute price movement, the indicator evaluates the relative position of consecutive highs and lows, allowing the market structure to evolve naturally as new pivots are confirmed.
If price forms a stronger extreme before an opposite pivot appears, the existing structural point is updated instead of creating an additional swing.
This approach keeps the structure consistent during fast impulsive movements while reducing unnecessary structural clutter.
WaveScope also includes dedicated Double Pivot Resolution logic to correctly process situations where both Pivot High and Pivot Low are confirmed simultaneously.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔄 BOS & CHoCH Detection
Once market structure has been established, the latest confirmed highs and lows become active structural reference levels.
A breakout that occurs in the direction of the existing structure is classified as Break of Structure (BOS).
A breakout against the current structural direction is classified as Change of Character (CHoCH).
Breakouts can be confirmed using either:
• candle close;
• candle wick.
This provides additional flexibility for different analytical approaches and varying market conditions.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 Developing Structure
Alongside confirmed swings, WaveScope visualizes the developing market structure.
A dynamic dashed line extends from the latest confirmed structural point to the current developing high or low.
This line is updated continuously with each new candle and becomes part of the confirmed structure only after the next pivot has been validated.
By separating confirmed and developing structure, the indicator allows traders to monitor ongoing price development without modifying historical structural information.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🖥️ Information Panel
An optional information panel provides a concise summary of the current structural state, including:
• current market structure direction;
• latest confirmed structural point;
• latest BOS or CHoCH event.
The panel is designed to provide structural context without requiring the entire swing sequence to be reviewed.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎛️ Settings
Structure
• Pivot sensitivity
• Maximum displayed swings
• HH / HL / LH / LL labels
• BOS & CHoCH visualization
• Breakout confirmation method
• Maximum displayed structural events
Visuals
• Structure lines
• Glow effect
• Line width
• Label size
• Label offset
• Color customization
Information Panel
• Enable / disable
• Panel position
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✨ Core Features
WaveScope is built around a single market structure engine.
The HH / HL / LH / LL sequence serves as the foundation for all subsequent calculations.
The same structural model is used for BOS detection, CHoCH detection, developing structure visualization, and the information panel.
Key implementation features include:
• automatic replacement of stronger same-type swings;
• Double Pivot Resolution;
• independent visualization of confirmed and developing structure;
• automatic BOS and CHoCH classification;
• controlled chart object management for improved performance.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 Notes
WaveScope relies on confirmed Pivot High and Pivot Low formations.
As a result, new structural points appear only after the corresponding pivot has been confirmed.
The confirmation delay depends on the selected pivot sensitivity and is an inherent characteristic of confirmation-based market structure analysis.
This approach prioritizes structural consistency by relying on confirmed market data instead of preliminary estimates.
The developing structure visualization partially compensates for this characteristic by displaying the ongoing structural progression before confirmation.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 Usage Notes
Lower pivot sensitivity produces a more detailed market structure with a larger number of local swings.
Higher sensitivity filters smaller market fluctuations and emphasizes broader structural trends.
The HH / HL sequence represents bullish market structure, while LH / LL represents bearish market structure.
BOS identifies structural continuation, whereas CHoCH identifies structural transitions against the prevailing market direction.
WaveScope can be applied across different markets and timeframes by adjusting pivot sensitivity to match the desired structural scale.
Rather than focusing on individual price swings, the algorithm builds a continuous sequence of confirmed structural points using Pivot High and Pivot Low detection. This sequence serves as the foundation for all structural calculations performed by the indicator.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📖 Overview
Most market structure indicators simply connect confirmed pivots.
During strong directional moves this often creates either excessive structural noise or delays the representation of the current market movement until the next pivot has been confirmed.
WaveScope was designed around a different idea.
Instead of treating each pivot as an isolated event, the indicator continuously maintains the latest structural swing.
Until an opposite pivot is confirmed, the most recent structural point can be replaced whenever price creates a stronger extreme of the same type.
At the same time, the developing swing is displayed independently from the confirmed structure and is updated in real time.
This allows traders to observe:
• confirmed market structure;
• the current developing swing;
• BOS and CHoCH events;
• the current structural state through the information panel.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ How It Works
WaveScope uses symmetrical Pivot High and Pivot Low detection with configurable sensitivity.
Every confirmed pivot is compared with the previous confirmed pivot of the same type.
The result determines whether the new structural point is classified as:
• Higher High (HH)
• Higher Low (HL)
• Lower High (LH)
• Lower Low (LL)
Rather than measuring absolute price movement, the indicator evaluates the relative position of consecutive highs and lows, allowing the market structure to evolve naturally as new pivots are confirmed.
If price forms a stronger extreme before an opposite pivot appears, the existing structural point is updated instead of creating an additional swing.
This approach keeps the structure consistent during fast impulsive movements while reducing unnecessary structural clutter.
WaveScope also includes dedicated Double Pivot Resolution logic to correctly process situations where both Pivot High and Pivot Low are confirmed simultaneously.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔄 BOS & CHoCH Detection
Once market structure has been established, the latest confirmed highs and lows become active structural reference levels.
A breakout that occurs in the direction of the existing structure is classified as Break of Structure (BOS).
A breakout against the current structural direction is classified as Change of Character (CHoCH).
Breakouts can be confirmed using either:
• candle close;
• candle wick.
This provides additional flexibility for different analytical approaches and varying market conditions.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 Developing Structure
Alongside confirmed swings, WaveScope visualizes the developing market structure.
A dynamic dashed line extends from the latest confirmed structural point to the current developing high or low.
This line is updated continuously with each new candle and becomes part of the confirmed structure only after the next pivot has been validated.
By separating confirmed and developing structure, the indicator allows traders to monitor ongoing price development without modifying historical structural information.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🖥️ Information Panel
An optional information panel provides a concise summary of the current structural state, including:
• current market structure direction;
• latest confirmed structural point;
• latest BOS or CHoCH event.
The panel is designed to provide structural context without requiring the entire swing sequence to be reviewed.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎛️ Settings
Structure
• Pivot sensitivity
• Maximum displayed swings
• HH / HL / LH / LL labels
• BOS & CHoCH visualization
• Breakout confirmation method
• Maximum displayed structural events
Visuals
• Structure lines
• Glow effect
• Line width
• Label size
• Label offset
• Color customization
Information Panel
• Enable / disable
• Panel position
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✨ Core Features
WaveScope is built around a single market structure engine.
The HH / HL / LH / LL sequence serves as the foundation for all subsequent calculations.
The same structural model is used for BOS detection, CHoCH detection, developing structure visualization, and the information panel.
Key implementation features include:
• automatic replacement of stronger same-type swings;
• Double Pivot Resolution;
• independent visualization of confirmed and developing structure;
• automatic BOS and CHoCH classification;
• controlled chart object management for improved performance.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 Notes
WaveScope relies on confirmed Pivot High and Pivot Low formations.
As a result, new structural points appear only after the corresponding pivot has been confirmed.
The confirmation delay depends on the selected pivot sensitivity and is an inherent characteristic of confirmation-based market structure analysis.
This approach prioritizes structural consistency by relying on confirmed market data instead of preliminary estimates.
The developing structure visualization partially compensates for this characteristic by displaying the ongoing structural progression before confirmation.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 Usage Notes
Lower pivot sensitivity produces a more detailed market structure with a larger number of local swings.
Higher sensitivity filters smaller market fluctuations and emphasizes broader structural trends.
The HH / HL sequence represents bullish market structure, while LH / LL represents bearish market structure.
BOS identifies structural continuation, whereas CHoCH identifies structural transitions against the prevailing market direction.
WaveScope can be applied across different markets and timeframes by adjusting pivot sensitivity to match the desired structural scale.
Open-source script
In true PulseWire spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Trading tools by MarketStructureLab. Professional indicators, algorithms & market structure logic. Get access: marketstructurelab.com
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.
Open-source script
In true PulseWire spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Trading tools by MarketStructureLab. Professional indicators, algorithms & market structure logic. Get access: marketstructurelab.com
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.
