OPEN-SOURCE SCRIPT
SMA Multi-Sync Granville & MTF Counter

SMA Multi-Sync Granville & MTF Counter
Overview
This indicator is an environmental awareness tool that identifies when and to what level moving averages (SMAs) across multiple time frames align in the same direction, visualizing the timing and freshness of the trend.
Its greatest feature is that it does not simply determine synchronization; rather, it precisely distinguishes the time frame upon which synchronization is completed using the number of stars (★).
Key Features
1. Calculation of "Stars" Based on Confirmed Time Frame Trigger
The number of stars displayed upon synchronization completion indicates the signal's "temporal weight."
★ (1): Synchronization is completed upon confirmation of the displayed time frame.
★★ (2): Synchronization is completed upon confirmation of the next higher time frame (e.g., 15 minutes).
★★★ (3): Synchronization is completed upon confirmation of the next higher time frame (e.g., 1 hour). The more higher the time frame is confirmed, the more powerful the trend reversal or regression it acts as.
2. MTF Sync Panel
The table on the right side of the screen displays the price position (background) and MA direction (text) for each level (displayed to daily) in real time.
By watching the background and text colors match, you can understand the accumulation of energy before a star appears.
3. Cross Counter
The number of bars elapsed from the synchronization starting point (MA crossover, etc.) to the current bar is displayed numerically in the lower right corner.
The closer to "0" the number, the more likely it is the beginning of a trend, while the higher the number, the more likely it is the end of the trend (expiration date).
Usability of Input Settings
Min Stars (1-5) This sets the signal cutoff. Setting it to "2" eliminates noise caused by the displayed bar being confirmed and narrows down to only the moment when the higher bar is confirmed (★2 or higher).
Cancel Alert if MA Slope Same If the MA of the displayed time frame is already leaning in the same direction (leading), the confirmation (★1) on that time frame will be considered "not an initial move" and excluded.
5m TF: Use 30m SMA When using 5-minute time frames, this physically changes the ★2 trigger from the confirmation on the 15-minute chart to the confirmation on the 30-minute chart. This is effective when targeting milestones on larger time frames.
*If you have any questions about how to use this, please ask in the comments.
SMA Multi-Sync Granville & MTF Counter
概要
本インジケーターは、複数の時間足の移動平均線(SMA)が「いつ、どの階層まで同じ方向に揃ったか」を特定し、そのトレンドの**「確定タイミング」と「鮮度」**を可視化する環境認識ツールです。
最大の特徴は、単なる同調判定ではなく、**「どの時間足の確定(Close)によって同期が完成したか」**を星(★)の数で厳密に区別する点にあります。
主な機能
1. 確定足トリガーによる「星」の算出
同期が完成した瞬間に表示される星の数は、そのシグナルの「時間的な重み」を示します。
★(1つ):表示足の確定により同期が完成。
★★(2つ):1つ上の上位足(15分等)の確定により同期が完成。
★★★(3つ):2つ上の上位足(1時間等)の確定により同期が完成。 上位の足が確定する節目ほど、より強力なトレンドの転換・回帰として機能します。
2. MTF同期パネル
画面右側のテーブルで、各階層(表示足〜日足)の「価格の位置(背景)」と「MAの向き(文字)」をリアルタイムに表示します。
背景色と文字色が一致していく過程を見ることで、星が出る前の**「エネルギーの蓄積」**を把握できます。
3. クロスカウンター
同期の起点(MAクロス等)から、現在の足まで何本経過したかを右下に数値で表示します。
「0」に近いほど初動であり、数値が大きくなるほどトレンドの終盤(賞味期限切れ)である可能性を論理的に示唆します。
インプット設定の使い勝手
Min Stars (1-5) シグナルの足切り設定です。「2」に設定すれば、表示足の確定によるノイズを排除し、**上位足の確定が伴った瞬間(★2以上)**のみに絞り込めます。
Cancel Alert if MA Slope Same 表示足のMAがすでに同方向へ傾いている(先行している)場合、その足での確定(★1)を「初動ではない」とみなして除外します。
5m TF: Use 30m SMA 5分足運用時、★2のトリガーを「15分足」から「30分足」の確定に物理的に変更します。より大きな時間軸の節目を狙う場合に有効です。
※使い方が不明なところはコメントで聞いてください。
Overview
This indicator is an environmental awareness tool that identifies when and to what level moving averages (SMAs) across multiple time frames align in the same direction, visualizing the timing and freshness of the trend.
Its greatest feature is that it does not simply determine synchronization; rather, it precisely distinguishes the time frame upon which synchronization is completed using the number of stars (★).
Key Features
1. Calculation of "Stars" Based on Confirmed Time Frame Trigger
The number of stars displayed upon synchronization completion indicates the signal's "temporal weight."
★ (1): Synchronization is completed upon confirmation of the displayed time frame.
★★ (2): Synchronization is completed upon confirmation of the next higher time frame (e.g., 15 minutes).
★★★ (3): Synchronization is completed upon confirmation of the next higher time frame (e.g., 1 hour). The more higher the time frame is confirmed, the more powerful the trend reversal or regression it acts as.
2. MTF Sync Panel
The table on the right side of the screen displays the price position (background) and MA direction (text) for each level (displayed to daily) in real time.
By watching the background and text colors match, you can understand the accumulation of energy before a star appears.
3. Cross Counter
The number of bars elapsed from the synchronization starting point (MA crossover, etc.) to the current bar is displayed numerically in the lower right corner.
The closer to "0" the number, the more likely it is the beginning of a trend, while the higher the number, the more likely it is the end of the trend (expiration date).
Usability of Input Settings
Min Stars (1-5) This sets the signal cutoff. Setting it to "2" eliminates noise caused by the displayed bar being confirmed and narrows down to only the moment when the higher bar is confirmed (★2 or higher).
Cancel Alert if MA Slope Same If the MA of the displayed time frame is already leaning in the same direction (leading), the confirmation (★1) on that time frame will be considered "not an initial move" and excluded.
5m TF: Use 30m SMA When using 5-minute time frames, this physically changes the ★2 trigger from the confirmation on the 15-minute chart to the confirmation on the 30-minute chart. This is effective when targeting milestones on larger time frames.
*If you have any questions about how to use this, please ask in the comments.
SMA Multi-Sync Granville & MTF Counter
概要
本インジケーターは、複数の時間足の移動平均線(SMA)が「いつ、どの階層まで同じ方向に揃ったか」を特定し、そのトレンドの**「確定タイミング」と「鮮度」**を可視化する環境認識ツールです。
最大の特徴は、単なる同調判定ではなく、**「どの時間足の確定(Close)によって同期が完成したか」**を星(★)の数で厳密に区別する点にあります。
主な機能
1. 確定足トリガーによる「星」の算出
同期が完成した瞬間に表示される星の数は、そのシグナルの「時間的な重み」を示します。
★(1つ):表示足の確定により同期が完成。
★★(2つ):1つ上の上位足(15分等)の確定により同期が完成。
★★★(3つ):2つ上の上位足(1時間等)の確定により同期が完成。 上位の足が確定する節目ほど、より強力なトレンドの転換・回帰として機能します。
2. MTF同期パネル
画面右側のテーブルで、各階層(表示足〜日足)の「価格の位置(背景)」と「MAの向き(文字)」をリアルタイムに表示します。
背景色と文字色が一致していく過程を見ることで、星が出る前の**「エネルギーの蓄積」**を把握できます。
3. クロスカウンター
同期の起点(MAクロス等)から、現在の足まで何本経過したかを右下に数値で表示します。
「0」に近いほど初動であり、数値が大きくなるほどトレンドの終盤(賞味期限切れ)である可能性を論理的に示唆します。
インプット設定の使い勝手
Min Stars (1-5) シグナルの足切り設定です。「2」に設定すれば、表示足の確定によるノイズを排除し、**上位足の確定が伴った瞬間(★2以上)**のみに絞り込めます。
Cancel Alert if MA Slope Same 表示足のMAがすでに同方向へ傾いている(先行している)場合、その足での確定(★1)を「初動ではない」とみなして除外します。
5m TF: Use 30m SMA 5分足運用時、★2のトリガーを「15分足」から「30分足」の確定に物理的に変更します。より大きな時間軸の節目を狙う場合に有効です。
※使い方が不明なところはコメントで聞いてください。
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.