XAUUSD EMA Inversion [MatsukazeAlgo]🇬🇧 ENGLISH
A trend-following pullback entry system optimized for Gold (XAUUSD). Detects the EMA Inversion pattern: price pulls back into an EMA band, forms a Fair Value Gap, then violently reverses through it — flipping the FVG into an Inverted FVG (iFVG) — and closes back in the trend direction. This version adds four Gold-specific filters that the original does not include: session filtering, psychological level confluence, ATR exhaustion detection, and DXY divergence filtering.
Concepts
EMA Trend Alignment — Three Exponential Moving Averages define the trend: Fast (21), Medium (55), and Slow (200). For a bullish trend, price must be above all three, and optionally the Fast must be above the Medium. For a bearish trend, the inverse. This triple alignment ensures the system only operates in clear directional markets, not during choppy consolidation.
Value Band — The shaded zone between the Fast and Medium EMAs. In a trending market, price often pulls back to this zone before continuing. The band acts as a dynamic "buy zone" in uptrends and "sell zone" in downtrends. A minimum EMA gap filter (default: $5) ensures the band is wide enough to indicate a real trend, not a flat market.
Fair Value Gap (FVG) — A three-candle pattern where a gap exists between the high of bar and the low of bar (bullish) or between the low of bar and the high of bar (bearish). FVGs represent price imbalances where one side of the market was dominant. The indicator tracks these as they form during the pullback phase.
Inversion FVG (iFVG) — The signal trigger. When price has pulled back into the value band and an FVG has formed, the indicator watches for price to close completely through the FVG in the opposite direction. This "inversion" means the imbalance was filled and rejected — a high-probability sign that the original trend is resuming. The FVG box on the chart changes colour at the moment of inversion.
Why These Components Work Together — The EMA alignment confirms the macro trend. The value band defines the pullback zone. The FVG marks the imbalance created during the pullback. The inversion confirms that the pullback is over and the trend is resuming. Each layer reduces noise: trend → pullback → imbalance → confirmation. Without any one of these layers, the signal would fire too often or too late.
How It Works
1. Trend Check: Fast, Medium, and Slow EMAs must be aligned. Minimum EMA gap must be met.
2. Pullback Detection: Price enters the value band (between Fast and Medium EMAs). The setup state activates.
3. FVG Formation: While the setup is active, the indicator tracks bullish and bearish FVGs.
4. Inversion Trigger: Price closes through a tracked FVG in the trend direction. Signal fires.
5. Trade Management: TP and SL are calculated from the recent swing high/low range. A cooldown period prevents re-entry after exits.
6. MTF Dashboard: Three configurable timeframes are scanned simultaneously. Each shows the current signal state (LONG / SHORT / PULLBACK / HIT TP / HIT SL / NONE).
Gold-Specific Filters
Session Filter — Gold produces frequent fakeouts during the Tokyo session due to thin liquidity and stop-hunting. Signals during Tokyo are excluded by default. London and NY are the primary Gold trading sessions where institutional volume backs the move. Individual toggles for Tokyo, London, and NY allow customisation.
Psychological Level Confluence — Gold respects $50 and $100 round numbers as institutional order clusters. When an iFVG forms within a configurable proximity (default: $15) of a round number, the signal is highlighted with a gold ★ marker and the iFVG box changes to a gold colour. This confluence indicates that the inversion is occurring at a level where real institutional orders are concentrated.
ATR Exhaustion Filter — When the current daily range has consumed a large percentage of the 14-period daily ATR, the remaining move potential is limited. Signals are suppressed when daily range exceeds the configured threshold (default: 80% of ATR). This prevents entries at the tail end of extended moves where the risk/reward has deteriorated.
DXY Divergence Filter — Gold and the US Dollar Index move inversely. When enabled (default: OFF), this filter only permits long signals when DXY is declining and short signals when DXY is rising. This ensures entries align with the macro Gold/Dollar relationship. The filter checks the bar-to-bar DXY change on the same timeframe.
Session Background — Optional coloured chart background showing Tokyo (rose), London (teal), and NY (sky) sessions. Disabled by default. Useful for understanding which session produced a signal.
Input Reference
Setup — Require Fast/Slow EMA Crossover (default OFF), Limit to One Active Setup (default ON), Minimum EMA Gap (default $5), Cooldown Candles (default 5), Swing Lookback (default 10).
Gold Filters — Session Filter (default ON) with individual Tokyo/London/NY toggles. Psych Level Confluence (default ON) with interval ($50) and proximity ($15). ATR Exhaustion Filter (default ON) at 80%. DXY Divergence Filter (default OFF). Session Background (default OFF).
Visuals — Fast EMA (21, default hidden), Medium EMA (55, default hidden), Slow EMA (200, default hidden), EMA Band (default ON), TP/SL Lines (default OFF), iFVG Box Colours (Long: green, Short: red), Max iFVGs (5), Extend Limit (5 bars), Psych Confluence Colour (gold).
MTF Dashboard — Show Scanner (default ON), Position (Top Right), Theme (Dark), Timeframes (5m / 15m / 60m). Displays current session and signal status per timeframe.
Alerts — Short Setup, Long Setup, Short + Psych Level, Long + Psych Level.
Conclusion
XAUUSD EMA Inversion combines EMA trend alignment, value band pullback detection, Fair Value Gap tracking, and FVG inversion confirmation into a single system. Each layer narrows the signal: only when all four conditions align does the indicator fire. The Gold-specific filters add session awareness, psychological level confluence, move exhaustion detection, and Dollar correlation — context that a generic EMA inversion system cannot provide. The MTF dashboard scans three timeframes simultaneously so you can see whether the setup is forming across multiple resolutions.
---
Based on EMA Inversion by isthattyler . This version adds session filtering (Tokyo excluded by default), psychological level confluence detection, ATR exhaustion filter, DXY divergence filter, MTF session display, and v6 optimization with Gold-tuned EMA parameters (21/55/200).
---
🇯🇵 日本語
ゴールド(XAUUSD)に最適化したトレンドフォロー型プルバックエントリーシステムです。EMAインバージョンパターンを検出します:価格がEMAバンドにプルバック → Fair Value Gap(FVG)が形成 → 価格がFVGを突き抜けてiFVG(反転FVG)に変換 → トレンド方向に確定。4つのGold専用フィルター(セッション、心理的価格帯、ATR消化率、DXY)を追加。
コンセプト
EMAトレンド整列 — 3本のEMA(Fast 21 / Medium 55 / Slow 200)でトレンドを定義。強気トレンドでは価格が3本全ての上に位置。3重整列により明確な方向性のある市場でのみ機能。
バリューバンド — FastとMedium EMAの間のゾーン。トレンド中の価格はしばしばこのゾーンにプルバックしてから継続。最小EMAギャップフィルター(デフォルト$5)で横ばい市場を除外。
Fair Value Gap(FVG) — 3本のローソク足パターン。bar の高値とbar の安値の間にギャップが存在する状態。価格の不均衡を表す。プルバック中に形成されたFVGを追跡。
Inversion FVG(iFVG) — シグナルトリガー。プルバック中にFVGが形成された後、価格がFVGを反対方向に完全に突き抜けて確定。この「反転」は不均衡が埋められて拒否されたことを意味し、元のトレンドが再開する高確率のサイン。チャート上でFVGボックスの色が反転の瞬間に変わる。
各コンポーネントが機能する理由 — EMA整列がマクロトレンドを確認。バリューバンドがプルバックゾーンを定義。FVGがプルバック中の不均衡をマーク。反転がプルバック終了とトレンド再開を確認。各レイヤーがノイズを削減:トレンド → プルバック → 不均衡 → 確認。
仕組み
1. トレンド確認:3本のEMAが整列。最小EMAギャップを確認。
2. プルバック検出:価格がバリューバンド(Fast-Medium EMA間)に進入。セットアップ状態が起動。
3. FVG形成:セットアップ中に強気/弱気FVGを追跡。
4. 反転トリガー:価格がFVGをトレンド方向に突き抜けて確定。シグナル発火。
5. トレード管理:直近のスイング高値/安値レンジからTP/SLを計算。クールダウン期間で過剰トレードを防止。
6. MTFダッシュボード:3つの時間足を同時スキャン。各時間足のシグナル状態を表示。
ゴールド専用フィルター
セッションフィルター — 東京セッションの薄商いによるフェイクアウトを除外(デフォルトOFF)。ロンドン/NYの機関投資家ボリュームに裏打ちされたシグナルのみ。
心理的価格帯合流 — $50/$100のラウンドナンバー付近でiFVGが形成された場合、ゴールド色★マーカーでハイライト。機関投資家の注文が集中するレベルでの反転 = 高確率。
ATR消化率フィルター — 日足レンジがATR(14)の80%以上を消化済みの場合、シグナルを抑制。伸びきった動きの末尾でのエントリーを防止。
DXY逆相関フィルター — DXYがゴールドと逆方向に動く時のみシグナル(デフォルトOFF)。マクロなゴールド/ドル関係に整合したエントリーのみ。
入力パラメータ
セットアップ — EMAクロスオーバー必須(デフォルトOFF)、アクティブセットアップ制限(デフォルトON)、最小EMAギャップ($5)、クールダウン(5本)、スイング期間(10)。
ゴールドフィルター — セッションフィルター(ON)東京/ロンドン/NY個別トグル。心理的合流(ON)間隔$50/近接距離$15。ATR消化率フィルター(ON)80%。DXY逆相関フィルター(OFF)。
ビジュアル — Fast EMA(21、非表示)、Med EMA(55、非表示)、Slow EMA(200、非表示)、EMAバンド(ON)、TP/SLライン(OFF)、iFVGボックス色。
MTFダッシュボード — スキャナー(ON)、位置(右上)、テーマ(ダーク)、時間足(5分/15分/60分)。
まとめ
XAUUSD EMA InversionはEMAトレンド整列、バリューバンドプルバック検出、FVG追跡、FVG反転確認を1つのシステムに統合。4つの条件が全て揃った時のみシグナルを発火。ゴールド専用フィルターがセッション意識、心理的価格帯合流、動き消化検出、ドル相関の文脈を追加。MTFダッシュボードが3つの時間足を同時スキャン。
---
Based on EMA Inversion by isthattyler . セッションフィルター(東京デフォルト除外)、心理的価格帯合流検出、ATR消化率フィルター、DXY逆相関フィルター、MTFセッション表示、v6最適化(Gold向けEMAパラメータ 21/55/200)を追加。
Индикатор Pine Script®






















