OPEN-SOURCE SCRIPT

Structure Break & Liquidity Sweep

3 527
Structure Break & Liquidity Sweep

Structure Break & Liquidity Sweep is a market structure indicator built around real-time swing detection, liquidity sweep identification, and structure-based confirmation tools.

This version is based on the open-source Smart Money Concepts framework originally published by LuxAlgo, with additional modifications and visual extensions focused on swing labeling, sweep visualization, directional signaling, and chart readability.

Overview

The indicator combines several structure-analysis modules into one script:

internal market structure

swing market structure

liquidity sweep detection

swing point visualization

order blocks

equal highs and equal lows

fair value gaps

premium / discount zones

previous day / week / month levels

optional LONG / SHORT confirmation signals

The goal of the script is not to predict the market, but to help traders organize price action using objective structural references.

Core logic

The script tracks two structure layers:

1. Internal structure
This layer reacts faster and highlights shorter-term BOS / CHoCH behavior.

2. Swing structure
This layer is slower and reflects broader structural pivots and higher-level directional shifts.

The script also detects swing highs and swing lows using pivot logic. These points can be displayed visually on the chart and optionally labeled as:

SH = Swing High

SL = Swing Low

On top of that, the script identifies liquidity sweeps when price trades beyond a previously detected swing level and then closes back through it. These events can optionally be marked with white sweep triangles and SW labels.

Included tools

Structure detection

Internal BOS / CHoCH

Swing BOS / CHoCH

Liquidity tools

Swing highs / lows

Sweep detection from wick-based or body-based logic

Equal highs / lows

Price delivery tools

Fair value gaps

Internal and swing order blocks

Premium / discount zones

Context tools

Daily / weekly / monthly reference levels

Optional candle coloring

Optional trend background

Optional LONG / SHORT signals derived from structure events

Signal logic

The optional LONG / SHORT markers are based on structure confirmations selected by the user.

Signals can be filtered by:

source: Internal, Swing, or Both

type: BOS, CHoCH, or All

optional cooldown between signals

These markers are intended as visual structure confirmations, not as standalone trading advice.

What is modified in this version

Compared with the original LuxAlgo open-source concept, this version adds and/or customizes:

dedicated swing-point markers

optional SH / SL text labels

dedicated sweep markers with optional SW text

simplified visual highlighting for swings and sweeps

configurable LONG / SHORT confirmation markers

background bias display

practical chart-focused visual adjustments

Attribution

This script is a modified derivative of the open-source Smart Money Concepts script originally published by LuxAlgo.

The original structural foundation and parts of the concept come from LuxAlgo’s work.
All credit for the original base logic belongs to LuxAlgo.

This publication presents a modified version with added visual and functional changes.

Notes

The script is designed for chart analysis and discretionary trading workflows.

It can be used on multiple markets and timeframes.

Some modules are more useful in trending conditions, while others can help frame liquidity events in consolidations.

Users should test settings according to the instrument and timeframe they trade.

Disclaimer

This script is provided for educational and informational purposes only.
It does not constitute financial, investment, or trading advice.
Always use your own risk management and independent judgment.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน