Technical User Guide: SFA Z-Score (v1.26)

SFA Z-Score is a basket (index) analysis indicator designed for the Forex market. It measures the relative strength and weakness of the base and quote currencies for the current financial instrument, while also calculating their differential and a synthetic USD index.

Unlike standard oscillators applied to a single chart's price, the indicator constructs dynamic synthetic baskets from Forex pairs, calculates a normalized deviation metric (Z-Score) for each currency individually, and outputs the result in a separate subwindow. This enables traders to objectively identify which specific currency is driving the price movement on the chart.

Methodology & Calculation Logic

  1. Currency Basket Construction:For the target currency, a basket of pairs is automatically built using the remaining major currencies (USD, EUR, GBP, AUD, NZD, CAD, CHF, JPY), excluding the currencies of the current chart to prevent data looping.
  2. Z-Score Calculation: A Z-Score is calculated for each instrument in the basket on every bar. This relative statistical metric evaluates how far the current price has deviated from its mean, expressed in standard deviations (sigma). Calculating the Z-Score normalizes the price dynamics of completely different currency pairs into a single standardized scale for accurate comparison.
  3. Aggregation & Smoothing:
    • The calculated Z-Score values across all available basket pairs are averaged to produce a unified currency index.
    • Additional smoothing is applied to the aggregated value to eliminate market noise.
  4. Extreme Spike Capping (LimitSpikes):When enabled, values exceeding the defined threshold are capped at the upper and lower limits to prevent chart scaling distortions during extreme volatility spikes.
  5. Differential Calculation (Difference):The FX Difference line is calculated as the net difference between the final Z-Score values of the base and quote currencies, highlighting the raw numerical dominance of one currency over the other.

Visual Signals & Chart Interpretation

The indicator renders in a separate subwindow below the main price chart:

  • Zero Line (0.00): Statistical mean (average market state over the specified period).
  • Signal Levels (+2.00 and -2.00): Boundaries of normal statistical distribution. A line above +2.0 indicates strong currency overbought conditions, while a line below -2.0 signifies strong oversold conditions relative to the entire basket.
  • Base Line (Base Currency): Strength dynamics of the current pair's base currency.
  • Quote Line (Quote Currency): Strength dynamics of the current pair's quote currency.
  • Difference Line (Base - Quote): Resultant directional vector of the pair. An upward crossover above zero indicates a net advantage of the base currency over the quote currency.
  • USD Line (USD Index): Dotted line showing the market-wide status of the USD for additional macro context.
  • Interactive Legend: Displays in the upper-left corner of the subwindow. Shows line colors, currency names, and their current real-time Z-Score values on the latest bar.

Input Parameters Guide

Algorithmic Settings

  • ZScorePeriod (Default: 200): Historical sample period for calculating the mean and standard deviation.
  • SmoothLength (Default: 5): Period for the final smoothing of the resulting Z-Score curve.

Spike Filter Settings

  • LimitSpikes (Default: true): Toggles the capping of extreme statistical spikes.
  • MaxSigmaLimit (Default: 4.0): Maximum allowable threshold in absolute value. Any values exceeding +4.0 or falling below -4.0 are clipped to this boundary.

Technical History Settings

  • MaxHistoryBars (Default: 3000): Maximum number of history bars requested for basket calculations.
  • RecalcSafetyMargin (Default: 20): Number of recent bars recalculated on every tick to ensure data synchronization.

Line Inversion

  • InvertBase (Default: false): Inverts the base currency plot.
  • InvertQuote (Default: false): Inverts the quote currency plot.
  • InvertUSD (Default: false): Inverts the USD index plot.

Plot Visibility Toggle

  • ShowBase (Default: true): Toggles visibility of the base currency line.
  • ShowQuote (Default: true): Toggles visibility of the quote currency line.
  • ShowDiff (Default: true): Toggles visibility of the difference line (Base - Quote).
  • ShowUSD (Default: false): Toggles visibility of the USD index line.

Line Width Settings

  • WidthBase (Default: 2): Line width for the base currency.
  • WidthQuote (Default: 2): Line width for the quote currency.
  • WidthDiff (Default: 1): Line width for the difference line.
  • WidthUSD (Default: 1): Line width for the USD index line.

Legend Settings

  • ShowLegend (Default: true): Enables or disables the subwindow legend panel.

Technical Requirements & System Behavior

  • Automatic Symbol Matching: The indicator automatically parses broker-specific ticker formats (e.g., custom prefixes or suffixes like EURUSD.ecn or mEURUSD), enabling seamless basket aggregation without manual configuration.
  • Symbol Availability: For proper calculation, your trading terminal must have access to major currency pairs involving EUR, GBP, AUD, NZD, CAD, CHF, JPY, and USD.