OPEN-SOURCE SCRIPT
Strict 1H WTS Structure

## Strict 1H WTS Structure
This indicator identifies a confirmed **1-hour market structure shift (WTS)** using strict, rule-based logic. It focuses only on structure and does not include FVGs, order blocks, lower-timeframe entries, or additional filters.
The indicator always calculates market structure on the **1-hour timeframe**, regardless of the chart timeframe.
### Core logic
Market structure is calculated using candle bodies:
* Body high = the higher value between open and close.
* Body low = the lower value between open and close.
* Wicks are ignored for structural breaks.
Confirmed body-based swing points are used to define the market structure.
### Structural levels
The indicator tracks:
* HH — Higher High
* HL — Higher Low
* LH — Lower High
* LL — Lower Low
A local high or low does not automatically become a structural level.
A swing becomes structural only after a completed pullback and subsequent continuation:
* In a bullish structure, a potential HL is confirmed only after price creates a new HH.
* In a bearish structure, a potential LH is confirmed only after price creates a new LL.
This prevents minor internal movements from being treated as major market structure.
### Bullish WTS
A bullish WTS can occur only when:
1. The market is in a confirmed bearish structure.
2. A candle closes above the last confirmed structural LH.
3. The break is made by the candle body, not only by the wick.
4. Price does not close back below the broken structural level.
5. A new high is created after the break.
6. A confirmed HL forms above the broken structural level.
The bullish WTS signal is displayed only after all conditions are confirmed.
### Bearish WTS
A bearish WTS can occur only when:
1. The market is in a confirmed bullish structure.
2. A candle closes below the last confirmed structural HL.
3. The break is made by the candle body, not only by the wick.
4. Price does not close back above the broken structural level.
5. A new low is created after the break.
6. A confirmed LH forms below the broken structural level.
The bearish WTS signal is displayed only after all conditions are confirmed.
### Candidate break
When price first closes beyond a structural level, the indicator displays:
**1H BREAK — WAIT**
This is not yet a confirmed WTS.
It means that the structural level has been broken, but the indicator is waiting for the pullback and confirmation of the new market structure.
### Cancelled WTS
If price closes back inside the previous structure before the new structure is confirmed, the setup is cancelled.
The indicator displays:
**NO WTS**
Examples:
* A bullish candidate is cancelled when price closes back below the broken structural high.
* A bearish candidate is cancelled when price closes back above the broken structural low.
### Confirmed signals
**1H WTS LONG**
The bearish structure has been broken and a new bullish HH–HL structure has been confirmed.
**1H WTS SHORT**
The bullish structure has been broken and a new bearish LL–LH structure has been confirmed.
### Displayed levels
The indicator displays:
* Confirmed structural high.
* Confirmed structural low.
* Structural level currently being tested after a body break.
* Candidate break labels.
* Confirmed WTS labels.
* Cancelled candidate labels.
### Alerts
The indicator includes two alert conditions:
* Confirmed 1H Bullish WTS.
* Confirmed 1H Bearish WTS.
Alerts trigger only after the complete structure-shift confirmation process.
### Important
A wick through a structural level is not considered a break.
A simple candle close beyond a level is not automatically considered a confirmed WTS.
The indicator requires:
> Structural body break → no return into the old structure → completed pullback → confirmation of the new structure.
This indicator is designed as a strict market-structure engine rather than an entry-signal system.
This indicator identifies a confirmed **1-hour market structure shift (WTS)** using strict, rule-based logic. It focuses only on structure and does not include FVGs, order blocks, lower-timeframe entries, or additional filters.
The indicator always calculates market structure on the **1-hour timeframe**, regardless of the chart timeframe.
### Core logic
Market structure is calculated using candle bodies:
* Body high = the higher value between open and close.
* Body low = the lower value between open and close.
* Wicks are ignored for structural breaks.
Confirmed body-based swing points are used to define the market structure.
### Structural levels
The indicator tracks:
* HH — Higher High
* HL — Higher Low
* LH — Lower High
* LL — Lower Low
A local high or low does not automatically become a structural level.
A swing becomes structural only after a completed pullback and subsequent continuation:
* In a bullish structure, a potential HL is confirmed only after price creates a new HH.
* In a bearish structure, a potential LH is confirmed only after price creates a new LL.
This prevents minor internal movements from being treated as major market structure.
### Bullish WTS
A bullish WTS can occur only when:
1. The market is in a confirmed bearish structure.
2. A candle closes above the last confirmed structural LH.
3. The break is made by the candle body, not only by the wick.
4. Price does not close back below the broken structural level.
5. A new high is created after the break.
6. A confirmed HL forms above the broken structural level.
The bullish WTS signal is displayed only after all conditions are confirmed.
### Bearish WTS
A bearish WTS can occur only when:
1. The market is in a confirmed bullish structure.
2. A candle closes below the last confirmed structural HL.
3. The break is made by the candle body, not only by the wick.
4. Price does not close back above the broken structural level.
5. A new low is created after the break.
6. A confirmed LH forms below the broken structural level.
The bearish WTS signal is displayed only after all conditions are confirmed.
### Candidate break
When price first closes beyond a structural level, the indicator displays:
**1H BREAK — WAIT**
This is not yet a confirmed WTS.
It means that the structural level has been broken, but the indicator is waiting for the pullback and confirmation of the new market structure.
### Cancelled WTS
If price closes back inside the previous structure before the new structure is confirmed, the setup is cancelled.
The indicator displays:
**NO WTS**
Examples:
* A bullish candidate is cancelled when price closes back below the broken structural high.
* A bearish candidate is cancelled when price closes back above the broken structural low.
### Confirmed signals
**1H WTS LONG**
The bearish structure has been broken and a new bullish HH–HL structure has been confirmed.
**1H WTS SHORT**
The bullish structure has been broken and a new bearish LL–LH structure has been confirmed.
### Displayed levels
The indicator displays:
* Confirmed structural high.
* Confirmed structural low.
* Structural level currently being tested after a body break.
* Candidate break labels.
* Confirmed WTS labels.
* Cancelled candidate labels.
### Alerts
The indicator includes two alert conditions:
* Confirmed 1H Bullish WTS.
* Confirmed 1H Bearish WTS.
Alerts trigger only after the complete structure-shift confirmation process.
### Important
A wick through a structural level is not considered a break.
A simple candle close beyond a level is not automatically considered a confirmed WTS.
The indicator requires:
> Structural body break → no return into the old structure → completed pullback → confirmation of the new structure.
This indicator is designed as a strict market-structure engine rather than an entry-signal system.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。