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が提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。