OPEN-SOURCE SCRIPT
ที่อัปเดต:

SMT Divergence & ICT Killzones

5 017
Overview
This open-source indicator combines SMT-style divergence detection, ICT killzone context, and a Midnight Open reference on a single chart. It is intended for users who want to review correlation-based divergence conditions together with fixed New York session timing and a daily reference level in one workflow.

Why this script was created
This script was created to reduce the need to switch between separate tools for SMT comparison, session timing, and daily reference levels. Instead of checking these elements one by one, the indicator keeps them on the same chart so they can be reviewed together.

How it works
The script compares confirmed swing highs and lows on the chart symbol with those of a user-selected comparison symbol. When one market confirms a new swing extension while the comparison market does not confirm a similar extension, the script marks an SMT-style divergence condition.
In addition to the divergence logic, the script highlights London and New York killzone windows using fixed New York session timing and plots Midnight Open as a daily reference line.
Signals are based on confirmed pivots, so they appear after confirmation rather than on the exact turning bar.

How to use it
Choose a comparison symbol that has a meaningful relationship with the chart symbol. For example, users may compare BTCUSDT with ETHUSDT, or use other markets that are commonly reviewed together.
A practical way to use the script is to review SMT signals together with the killzone background and the Midnight Open level rather than treating the signal marker by itself as a complete trade decision.
Standard candlestick charts are recommended for visual consistency.

Inputs
Correlation Symbol — Selects the market used for SMT comparison. The most useful results usually come from symbols with a meaningful relationship to the chart symbol.
Timeframe — Sets the timeframe used for the comparison symbol. If left empty, the chart timeframe is used. Using a different timeframe changes how often comparison pivots update and can change the timing of divergence markings.
Swing Length — Controls pivot confirmation sensitivity. Higher values require more bars to confirm a pivot, which usually produces fewer signals and more delay. Lower values react faster but can produce more frequent signals.
Show Killzone Background — Shows or hides the London and New York killzone background.
Show Midnight Open — Shows or hides the Midnight Open reference line.
Display Timezone — Controls the display-related timezone behavior used where applicable. Killzone calculations remain aligned to New York session timing.
Bearish / Bullish Color — Sets the visual colors of bearish and bullish SMT markings.
Outside Killzone Transparency — Reduces the visual emphasis of signals that form outside killzone windows. Increasing this value makes off-session signals less visually prominent.
Max Historical Objects — Limits how many historical SMT drawings remain on the chart at the same time. Lower values keep the chart cleaner, while higher values preserve more historical context.

How changing the settings affects the output
Increasing Swing Length makes pivot confirmation stricter. This usually reduces the number of signals, but it also delays them further.
Lowering Swing Length makes the script react faster, but it can also increase the number of marked conditions.
Changing the Correlation Symbol changes the relationship being evaluated. Closely related markets are usually easier to interpret than unrelated ones.
Changing the Timeframe for the comparison symbol changes the pace at which comparison pivots form, which can materially change when divergence conditions appear.
Increasing Outside Killzone Transparency makes off-session signals less visually prominent.
Reducing Max Historical Objects removes older drawings sooner and keeps the chart cleaner.

Use context
This script is most useful when the chart symbol and comparison symbol have a meaningful relationship and when session timing matters in the user’s workflow. It is designed to help users review divergence conditions together with session context and a daily reference level, rather than isolate them as separate tools.

Limitations
The usefulness of the output depends heavily on the chosen comparison symbol. Weakly related or unrelated symbols can reduce the value of SMT readings.
Because the logic uses confirmed pivots, signals appear after confirmation rather than on the exact turning bar.
In sideways or choppy conditions, divergence readings can become less informative.
Heikin Ashi, Renko, Line Break, Kagi, Point & Figure, and Range charts can produce less reliable visual interpretation because they do not use standard price construction.

Design notes
This script combines confirmed SMT-style comparison logic, fixed ICT killzone timing tied to New York session hours, and a Midnight Open reference in one workflow.
It also manages historical lines and labels so the chart does not keep accumulating drawings without limit, which helps keep the visual layout more controlled over time.
Release Note
This update changes how SMT conditions are paired between the chart symbol and the comparison symbol.

Confirmed pivot history is now stored on both symbols. When a new main pivot sequence is available, the script searches the comparison symbol's confirmed pivot history for the closest valid pivot pair using time-based tolerance. This is intended to reduce mismatch cases when related markets do not confirm pivots at the same time.

The comparison timeframe is now restricted to the chart timeframe or higher. Lower comparison timeframes are rejected because they can produce structurally inconsistent SMT readings.

Midnight Open handling was also revised. On supported intraday and daily contexts, the script now uses lower-timeframe day-change detection where needed so the daily reference updates more consistently. Midnight Open tracking is not maintained above 1D.

The update also improves duplicate-control behavior so the same main pivot sequence is less likely to produce repeated SMT markings.

The current version tracks confirmed pivots on both the chart symbol and the comparison symbol, then matches the most relevant comparison pivot pair using time-based tolerance. The comparison timeframe must be equal to or higher than the chart timeframe, and Midnight Open tracking is intended for supported intraday and daily contexts.
Release Note
SMT Divergence & ICT Killzones is an open-source indicator designed to compare confirmed swing structure between two correlated markets while keeping key session context on the chart. The purpose of this script is not to predict every reversal or act as a complete trading system, but to help traders identify when one market confirms a move and the related market does not. This version keeps the original SMT idea intact while improving reliability, clarity, and chart behavior.

The update focuses on making the script more accurate and easier to use. Confirmed pivot logic is preserved, but the implementation has been cleaned up so pivot history, object management, and chart overlays behave more consistently. Session labels, future session boxes, SMT lines, and labels are handled more carefully to reduce stale objects and visual clutter. The Midnight Open feature was also revised so the script no longer falls back to the current bar open when a valid midnight value cannot be resolved safely for the selected timezone. If the true value cannot be confirmed, the line remains hidden instead of displaying a misleading level. Time-based safeguards were also strengthened so the script requires a time-based chart and a valid comparison timeframe setup.

In practical use, the script helps traders compare relative strength and weakness between correlated assets by detecting confirmed bearish and bullish SMT conditions at swing highs and swing lows. It also adds optional ICT session context through Killzones and an optional Midnight Open reference. This makes it useful for traders who want to read divergence in context rather than as an isolated signal.

This script is published as open-source so users can inspect the logic, learn from it, and adapt it to their own workflow. It is best used as a structure-reading tool, not as a standalone execution system. Because it is pivot-based, signals appear only after confirmation, and because it depends on time-based alignment, symbol selection and timeframe choice matter. Non-standard chart types may distort results.
Release Note
Update Notes

This version improves SMT accuracy and timeframe consistency across LTF and HTF charts.

What changed:

- SMT timeframe handling was tightened.
The SMT comparison now requires the correlation timeframe to match the chart timeframe. This prevents lower-timeframe price swings from being incorrectly matched with higher-timeframe correlation swings.

- HTF pairing tolerance was reduced.
On higher timeframes, the previous logic could allow pivot matches that were too far apart in time. The new logic keeps correlation matching closer to the actual swing being analyzed.

- LTF performance was improved.
Pivot history and scan depth are now limited, reducing unnecessary calculations on lower timeframes such as 1m, 3m, and 5m.

- Killzone logic now uses the actual pivot time.
Previously, SMT signals were visually classified using the confirmation bar. Since pivots confirm after a delay, this could mark a valid killzone SMT as outside the killzone, or the opposite. The new version checks the pivot timestamp instead.

- Midnight Open requests were optimized.
Multiple 1-minute data requests were combined into a single request to reduce overhead.

- A stricter correlation mode was added.
The new “Require Correlation Reversal” option allows users to choose between a flexible SMT interpretation or a stricter lower-high / higher-low confirmation model.

Why it changed:

The goal was to make SMT signals cleaner, more consistent, and less dependent on loose timeframe matching. The previous version could produce valid-looking signals that came from mismatched LTF/HTF structures, especially when the chart timeframe and correlation timeframe were different.

What this improves:

- Cleaner SMT detection
- Better HTF reliability
- Lighter LTF performance
- More accurate killzone highlighting
- Fewer forced or misleading divergence matches
- More control over strict vs flexible SMT interpretation

Expected behavior:

The indicator may now produce fewer signals, especially on HTF charts, but the signals should be better aligned with the actual market structure. For best results, use the chart timeframe as the SMT analysis timeframe and compare strongly correlated assets.

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

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