XAUUSD Parabolic SAR [MatsukazeAlgo]🇬🇧 ENGLISH
A session-aware Parabolic SAR indicator optimized for Gold (XAUUSD). The standard SAR produces frequent whipsaws during Asia's thin liquidity. This version dims Asia SAR dots to communicate lower reliability, while keeping London and NY dots vivid. Includes liquidity sweep detection, early warning proximity alerts, MTF trend alignment, and psychological level confluence.
Concepts
Parabolic SAR — The SAR places a trailing dot above price in a downtrend and below price in an uptrend. When price crosses the dot, the trend flips. The acceleration factor (AF) controls how quickly the dot catches up to price. A fast AF produces more signals in trending markets but generates whipsaws in ranging conditions.
Trend Age Fade — A fresh SAR flip carries more weight than one that has been running for 80 bars. This indicator tracks how many bars the current trend has been active and progressively fades the SAR dots as the trend ages. Fresh flips are fully opaque. Old trends fade toward transparency. This creates an automatic visual hierarchy without any settings.
Session Reliability — On Gold, the SAR is least reliable during Asia session due to thin liquidity and stop-run reversals. Rather than using different acceleration factors per session (which Pine Script's ta.sar() does not support dynamically), this version dims Asia SAR dots with extra transparency. At a glance, faded dots mean Asia — lower conviction. Vivid dots mean London/NY — institutional flow backing the trend.
Liquidity Sweep — A SAR flip that coincides with a sweep of a recent swing high or low (price broke the range then reversed) is a higher-quality signal. The sweep detector identifies when a bearish SAR flip follows a break above the recent range, or a bullish flip follows a break below it. These flips are marked with a ◆ marker.
Early Warning — When price gets within 10% of the SAR's initial risk distance, a triangle appears. The trend is losing momentum. This is not a reversal signal — it is a caution flag to tighten stops or prepare for a potential flip.
How It Works
1. SAR Calculation: Standard ta.sar() with configurable Start, Increment, and Maximum. The same parameters apply across all sessions.
2. Trend Age: A counter resets to 1 on every SAR flip and increments each bar. Transparency increases with age up to the configured fade duration.
3. Session Dimming: On intraday timeframes, Asia session SAR dots receive additional transparency. Daily and higher timeframes bypass session logic.
4. Liquidity Sweep: The indicator checks whether a bullish SAR flip follows a new low below the prior lookback range, or a bearish flip follows a new high above it.
5. MTF Alignment: A higher-timeframe SAR is calculated using request.security(). When the chart SAR and the higher-timeframe SAR agree on direction, the dashboard shows "Aligned".
6. Early Warning: On each SAR flip, the initial risk distance (close to SAR at entry) is recorded. When current price-to-SAR distance drops below 10% of that initial distance, a warning fires.
Gold-Specific Features
Asia Dimming — Asia session SAR dots receive configurable extra transparency (default +25%). Visually communicates lower reliability without removing the data. London/NY dots stay vivid.
Psychological Level Confluence — When a SAR flip occurs near a $50 or $100 round number, the flip marker turns gold. Gold respects round numbers as institutional order clusters. A SAR flip at $3,300 carries more weight than one at $3,317.
DXY Alignment — The stats table shows current DXY direction. Bullish SAR (price above SAR) aligned with DXY falling = macro-confirmed Gold long. Bearish SAR with DXY rising = macro-confirmed Gold short.
Session Flip Count — The stats table accumulates SAR flip counts by Asia / London / NY. Over time this shows which sessions produce the most directional SAR activity on your timeframe.
Alerts
4 alert types: SAR Flip (trend reversal), Psych Confluence (flip at round number), Liquidity Sweep (flip with prior range break), Early Warning (price approaching SAR).
Input Reference
SAR Logic — Start: initial acceleration factor (default 0.02). Increment: AF step per bar (default 0.02). Maximum: AF ceiling (default 0.2). ATR Length: ATR period for momentum score. MTF: higher timeframe for alignment check. Sweep Lookback: bars used to define the prior range for sweep detection.
Display — Bar Colouring: colour candles by SAR direction (default OFF). Trend Fade Duration: bars until SAR dots reach maximum transparency (default 50). Liquidity Sweep Markers: show ◆ on sweep flips (default ON). Early Warning: show △ when price approaches SAR (default ON).
Gold Settings — Asia Dimming: fade Asia session dots (default ON). Extra Transparency: additional opacity for Asia dots (default 25%). Psych Confluence: detect $50/$100 near SAR flips (default ON). Confluence Colour: colour for psych marker (default gold). DXY Alignment: show DXY direction in stats table (default ON).
Stats Table — Show Table (default ON), Position (9 positions), Size, Text/Title Colour. Displays: trend direction, momentum bar, MTF alignment, session with active AF, flip counts by session, psych confluence count, DXY direction.
Alerts — Individual toggles for each of the 4 alert conditions. All default to on.
Conclusion
XAUUSD Parabolic SAR adapts the classic trailing stop tool to Gold's session structure. Asia dots fade to signal lower conviction. London/NY dots stay vivid for institutional sessions. The trend age fade tells you at a glance whether a trend is fresh or exhausted. Psychological level confluence and DXY alignment add institutional context that a plain SAR cannot provide. Use it as a trend filter alongside other MatsukazeAlgo tools, or as a standalone trailing stop reference.
---
Based on Parabolic SAR Smart Filter by MarkitTick . This version replaces the Neon 3D visual style with the MatsukazeAlgo palette, adds Asia session dimming, psychological level confluence, DXY alignment, and session flip statistics.
---
🇯🇵 日本語
ゴールド(XAUUSD)に最適化されたセッション対応パラボリックSARインジケーターです。標準SARは東京セッションの薄商いでウィップソーが多発します。このバージョンでは東京SARドットを減光して信頼度の低さを伝え、ロンドン・NYドットは鮮明に保ちます。流動性スイープ検出、早期警告、MTFトレンド整合、心理的価格帯の合流を搭載。
コンセプト
パラボリックSAR — 下降トレンドでは価格上にドット、上昇トレンドでは価格下にドットを描画するトレーリングストップ指標。価格がドットを超えるとトレンドが反転。加速係数(AF)がドットの追跡速度を制御します。
トレンド年齢フェード — 新しいSAR反転は80バー続いた反転より重みがあります。現在のトレンドが何バー続いているかを追跡し、SARドットを徐々に薄くします。新しい反転は完全な濃さ、古いトレンドは透明に近づきます。自動的な視覚的優先順位。
セッション信頼性 — ゴールドでは東京セッションのSARが最も信頼性が低い(薄商い + ストップ狩り)。Pine ScriptのSARはセッション別の動的AF変更をサポートしないため、東京SARドットに追加透明度を適用。薄いドット=東京、鮮明なドット=ロンドン/NY。
流動性スイープ — 直近レンジを突破してから反転したSAR反転はより質の高いシグナル。◆マーカーで表示。
早期警告 — 価格がSARの初期リスク距離の10%以内に近づくと△が出現。トレンドが弱まっている警告。
仕組み
1. SAR計算:設定可能なStart/Increment/MaximumでSARを計算。全セッション同一パラメータ。
2. トレンド年齢:SAR反転でカウンター=1にリセット。バーごとに増加。設定したフェード期間まで透明度が上がる。
3. 東京減光:日中TFで東京セッションのSARドットに追加透明度。日足以上はセッションロジックをバイパス。
4. 流動性スイープ:ブル反転が直近安値割れ後か、ベア反転が直近高値超え後かを確認。
5. MTF整合:request.security()で上位TFのSARを計算。チャートSARと方向一致時にダッシュボードに「Aligned」。
6. 早期警告:各SAR反転時に初期リスク距離を記録。価格がSARに近づいた時に警告。
ゴールド専用機能
東京減光 — 東京セッションのSARドットに追加透明度(デフォルト+25%)。信頼度の低さを視覚的に伝えつつデータは保持。
心理的価格帯の合流 — SAR反転が$50/$100のラウンドナンバー付近で発生するとゴールド色に。ゴールドはラウンドナンバーを機関投資家の注文クラスターとしてリスペクトします。
DXYアライメント — 統計テーブルにDXY方向を表示。強気SAR + DXY下落 = マクロ整合のゴールドロング。
セッション別フリップ数 — テーブルにAsia/London/NYのSAR反転数を累積表示。
アラート
4種類:SAR反転、心理的合流、流動性スイープ、早期警告。
入力パラメータ
SAR設定 — Start(開始加速係数)、Increment(加速ステップ)、Maximum(AF上限)、ATR長さ、上位時間足、スイープルックバック。
表示 — バー色(デフォルトOFF)、トレンドフェード期間(デフォルト50)、スイープマーカー、早期警告。
ゴールド設定 — 東京減光(デフォルトON)、追加透明度(デフォルト25%)、心理的合流(デフォルトON)、合流色、DXYアライメント。
統計テーブル — テーブル表示(デフォルトON)、位置、サイズ、文字色。トレンド方向、モメンタムバー、MTF整合、セッション、フリップ数、心理的合流数、DXY方向を表示。
まとめ
XAUUSD Parabolic SARはゴールドのセッション構造に合わせてクラシックなトレーリングストップツールを適応させます。東京ドットを薄くして確信度の低さを示し、ロンドン/NYドットは機関投資家のセッション向けに鮮明に保ちます。トレンド年齢フェードにより、トレンドが新鮮か疲弊しているかが一目でわかります。他のMatsukazeAlgoツールと組み合わせてトレンドフィルターとして、または単体のトレーリングストップ参照として使用できます。
---
Based on Parabolic SAR Smart Filter by MarkitTick . Neon 3DビジュアルスタイルをMatsukazeAlgoパレットに置き換え、東京セッション減光、心理的価格帯合流、DXYアライメント、セッション別フリップ統計を追加。
Pine Script® indicator






















