OPEN-SOURCE SCRIPT

SMA Cross Counter - MTF Smooth

130
Title Idea
SMA Cross Counter - MTF Smooth (Find the 50-Bar Sweet Spot)

Description
Overview
This indicator tracks and displays the number of bars elapsed since the current 20SMA crossed the Higher Timeframe (HTF) 20SMA. By quantifying the "age" of a trend, it is designed to help traders identify high-probability pullbacks with objective precision.

Strategy: The 50-Bar Sweet Spot
This script is built around a specific tactical observation:

The Target: A "One-Cushion Granville Setup" occurring approximately 50 bars after the crossover is often a high-probability "Sweet Spot." At this stage, the trend is usually well-established but still possesses significant momentum.

The Edge: By monitoring the counter in the bottom-right corner, you can move away from subjective "feel" and objectively judge the trend's maturity. It helps you avoid the high volatility of an early cross and the exhaustion risks of a late-stage trend (e.g., over 100 bars).

Key Features
Automatic MTF Selection The reference timeframe updates automatically as you switch charts.

1m chart → 5m SMA

5m chart → 30m (or 15m) SMA

15m chart → 1h SMA

Daily chart → Weekly SMA, and so on.

Smooth MTF Visualization Eliminates the "stepped/staircase" effect common in MTF indicators. It connects higher-TF data points with smooth, diagonal lines, maintaining a clean chart and showing the true slope of the trend.

Real-Time Bar Counter Resets to "0" at the exact moment of a crossover and increments by 1 with every new bar.

Settings
5m Chart Reference: Choose between 30m or 15m as the HTF source when trading on a 5m chart.

SMA Period: Defaults to 20, but fully adjustable to fit your specific strategy.

タイトル案
SMA Cross Counter - MTF Smooth (50本目のスイートスポット判定)

説明文(日本語)
概要
このインジケーターは、現在の20SMAが上位足の20SMAと交差してからの「経過バー数」をリアルタイムでカウントし、右下のテーブルに表示します。 単なるクロスの確認ではなく、トレンドの「経過時間」を数値化することで、押し目買い・戻り売りの精度を極限まで高めるために開発されました。

戦略:50本目のスイートスポット
本インジケーターは、以下のトレード理論をベースに設計されています。

狙い目: SMA同士がクロスしてから50本程度経過したタイミングでの「ワンクッショングランビル」は、トレンドの勢いが安定し、かつ伸び代が最も残されている**「スイートスポット」**となる可能性が高い。

メリット: 右下のカウンターを見るだけで、感覚に頼らず「今がトレンドの何合目か」を客観的に判断できます。クロス直後の不安定な時期や、100本を超えたトレンド終盤の失速リスクを避けるのに有効です。

主な機能
自動タイムフレーム選定 (Auto-MTF) チャートの時間軸を切り替えるだけで、表示中の足に合わせて最適な上位足を自動選択します。(例:5分足なら30分足SMA、15分足なら1時間足SMAなど)

滑らかな上位足ライン MTF特有の「階段状のギザギザ」を排除。上位足の確定値を直線で結ぶため、チャートを美しく保ちつつ、正確なトレンドの傾きを確認できます。

リアルタイム・カウンター SMAがクロスした瞬間に「0」へリセット。以降、1本ごとに加算されます。

設定項目
5分足チャート時の参照先: 上位足を「30分」にするか「15分」にするかを切り替え可能。

SMA期間: デフォルトは20。ご自身の手法に合わせて調整してください。

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.