OPEN-SOURCE SCRIPT

Dynamic MTF Reversal Sequential [Realtime]

112
SMA Reversal Sequential MTF Engine
Professional Pivot Identification & Squeeze Analysis
1. Overview
The SMA Reversal Sequential MTF Engine is a sophisticated environment recognition tool that monitors 8 timeframes (1m to Monthly) to identify objective Pivot Highs and Lows.

Unlike standard indicators that rely on simple price-crosses, this engine determines structural market turns based on the curvature (slope) of the SMA. By automating the detection of price consolidation (Squeeze) and synchronizing it with higher timeframe trends, it provides a systematic approach to capturing high-probability breakout opportunities.

2. Input Settings & Operations
Each parameter is designed to help you filter noise and focus on the market structure that suits your trading style.

■ Main Settings
Use Short Period:

ON: Uses (5, 3, 7) periods. Ideal for scalping. It identifies micro-pivots and sensitive trend shifts.

OFF: Uses (20, 6, 20) periods. Designed for Day/Swing trading. It filters out noise and focuses on major structural highs and lows.

Hide Lower Timeframes:

Automatically hides labels from timeframes shorter than your current chart (e.g., hiding 1m labels while on a 1H chart) to maintain a clean workspace.

Break Label Right Offset:

Adjusts the horizontal position of the "Breakout" price labels on the right side of the chart.

■ Drawing Options
Show Only Current TF Labels:

When enabled, it hides "15", "1H" labels from other timeframes on the chart. Note: The MTF Dashboard will still track all timeframes regardless of this setting.

Show Trendlines & Channels:

Plots lines connecting determined Pivot Highs and Lows, visualizing the current "Trading Range" or "Channel."

Show ZigZag Line:

Connects the confirmed Highs and Lows with straight lines, making "Market Structure" (Higher Highs / Lower Lows) instantly recognizable.

Hide Outer Channel on Squeeze:

During a Squeeze (consolidation), this hides older wide channels to highlight the immediate converging boundaries.

3. Core Logic: Determining Highs & Lows
This engine determines "Pivots" through a logical three-step process:

SMA Reversal Detection: The engine calculates when the SMA slope changes from down to up (or vice versa) using a sequential offset comparison.

Pivot Determination: Once an SMA turn is confirmed, the highest/lowest price point during that turn is determined as a structural Pivot High/Low.

Squeeze Identification: When the last two determined Highs are "Lower Highs" and the last two Lows are "Higher Lows," the engine identifies a Squeeze (Triangle Consolidation) and marks it with a Green Dot (●).

4. How to Trade (Step-by-Step)
Check the MTF Dashboard: Look at the top-right table. If the higher timeframes (4H, 1D) are Blue, the market is in a structural uptrend (making new Highs).

Wait for the Squeeze: Wait for the Green Dot (●) on your current timeframe. This signifies that energy is being stored within a tight range.

The Breakout Signal: When the price breaks the squeeze in the direction of the higher timeframe trend, a Rocket (🚀) or Lightning (⚡) icon appears. This is a high-probability entry point where a lower-timeframe consolidation resolves into a higher-timeframe trend.

5. Important Notes
As an SMA-based tool, it is a "Lagging Indicator" by nature. It focuses on structural confirmation rather than predicting unpredictable price spikes.

Always prioritize the MTF Dashboard colors. Trading against the higher timeframe trend is not recommended.

SMA Reversal Sequential MTF Engine
〜多時間軸SMA反転による高値安値確定と保合い分析〜
1. 概要 (Overview)
本スクリプトは、8つの時間軸(1分足〜月足)におけるSMA(単純移動平均線)の傾きを解析し、**「主観を排除した客観的な高値・安値」**を自動で決定するマルチタイムフレーム(MTF)環境認識エンジンです。

最大の特徴は、価格の上下に一喜一憂するのではなく、移動平均線という「相場の平均的な流れ」が反転したポイントを「真の節目(Pivot)」として定義する点にあります。これにより、ボラティリティの収束(スクイーズ)と、上位足に同期した高確率なブレイクアウトをシステマチックに捉えることができます。

2. インプット設定の完全解説 (Input Settings)
ユーザーが設定画面で調整できる各項目の具体的な意味と、変更による効果を解説します。

■ 基本設定 (Main Settings)
短期設定を使用 (Use Short Period):

ON: 期間 (5, 3, 7) を使用。スキャルピングや短期トレード向け。非常に細かく高値・安値を決定し、微細な反転も逃さず捉えます。

OFF: 期間 (20, 6, 20) を使用。デイトレード〜スイング向け。ノイズを排除し、主要な大きな波の高値・安値のみを決定します。

下位足を非表示 (Hide Lower Timeframes):

ON: 現在のチャートより短い足(例:1時間足を表示中に1分・5分足のサインなど)を隠します。上位足の構造把握に集中し、チャートをスッキリさせたい時に有効です。

ブレイク文字の右オフセット:

チャート右側の余白に表示される価格情報の位置を調整します。数値が大きいほど右側に移動します。

■ 表示設定 (Drawing Options)
現在足のラベルのみ表示 (Show Only Current TF Labels):

ON: チャート上の「15」「1H」といった他時間足のサインを非表示にします。

利点: 右上のダッシュボードには全情報が維持されるため、視認性を高めつつ、MTF分析の精度を維持できます。

トレンドライン&チャネル (Show Trendlines & Channels):

確定した高値同士・安値同士を線で結びます。現在の価格が「どの価格幅の範囲内(チャネル)」で推移しているかを可視化します。

ZigZagライン (Show ZigZag Line):

確定した高値と安値を交互に直線で結びます。ダウ理論的な「上昇・下落の波」の推移が一目で把握可能になります。

保合い中は外側ラインを非表示:

収束(スクイーズ)が発生した際、古い広いチャネルを隠し、今まさに機能している収束ラインのみを際立たせます。

3. 核心ロジック:高値・安値の決定プロセス
本ツールは以下の手順でチャート上の構造を構築します。

SMA反転の検知: SMAの傾きが「下落→上昇」または「上昇→下落」に転じた瞬間を計算。

節点の確定: その反転が起きた前後の最高値・最安値を**「確定した高値・安値」**として決定し、ラベルを打ちます。

スクイーズ判定: 決定された「直近2つの高値」が切り下がり、かつ「直近2つの安値」が切り上がった場合を**三角保合い(スクイーズ)**と定義し、緑のドット(●)を表示します。

4. 実戦的な操作フロー
このインジケーターを使ってどのようにトレードを組み立てるかの推奨ステップです。

環境認識 (Environment Check): 右上のダッシュボードで上位足(4H, 1D等)の色を確認。青なら「買いの高値更新中」、赤なら「売りの安値更新中」です。

保合い待機 (Squeeze Watching): 現在の足に**緑のドット(●)**が出るのを待ちます。これは決定された節目が収束し、次に大きく動くためのエネルギーを蓄積している合図です。

ブレイクの判断 (Decision): 保合いを抜けた際、ダッシュボードの上位足と同じ方向であれば、**🚀(ロケット)や⚡(稲妻)**のアイコンが出現します。これが「上位足の勢いに乗った、下位足の収束解消」という、最も期待値の高いエントリーポイントです。

5. 注意事項
本ツールは移動平均線に基づく「遅行指標」の性質を持ちます。そのため、急激なスパイク(一瞬の突発的な動き)には反応しない場合があります。

常に「上位足のトレンドがどちらを向いているか」をダッシュボードで確認し、逆張りでの使用は避けることを推奨します。

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.