Technical User Guide: SFA Index (v5.94)

The SFA Cross Index indicator is designed for multi-currency analysis of the synthetic strength of the currencies comprising the current currency pair, as well as the clean US Dollar Index (USD Index).

The algorithm completely excludes the cross-components of the analyzed pair from its calculations—preventing mathematical feedback loops—and calibrates all calculated indices to the price scale of the current chart.

1. Methodology of Currency Basket Formation

The indicator is built around analyzing the dynamics of weighted currency baskets relative to a user-defined reference point (Anchor Bar).

A fixed set of 8 major global currencies is used for analysis: USD, EUR, GBP, AUD, NZD, CAD, CHF, and JPY.

When attached to a currency pair chart (e.g., EURUSD), the algorithm automatically creates three independent data structures:

  • Base Currency Basket (EUR): Formed from EUR pairs with all currencies on the list, excluding the quote currency (USD) and the base currency itself (EUR). The calculation includes 6 pairs: EURGBP, EURAUD, EURNZD, EURCAD, EURCHF, and EURJPY.
  • Quote Currency Basket (USD): Formed from USD pairs with all currencies on the list, excluding the base currency (EUR) and the quote currency itself (USD). The calculation includes 6 pairs: GBPUSD, AUDUSD, NZDUSD, USDCAD, USDCHF, and USDJPY.
  • Clean USD Basket: A separate, independent basket for the US Dollar, isolated from the influence of both currencies in the current instrument.

All resulting data series undergo a primary smoothing process configured by the user (SmoothLength), filtering out market noise without distorting underlying trend movements.

2. Graphical Elements and Interpretation

The indicator plots up to 4 buffer lines and custom user interface elements on the chart window:

  • Base Currency Index (Solid Line): Displays the clean dynamics of the current pair's base currency. Colors are assigned automatically based on the currency (e.g., Magenta/Fuchsia for EUR, Orange for GBP, Green for AUD).
  • Quote Currency Index (Solid Line): Displays the dynamics of the quote currency. Under standard settings, it moves upward as the quote currency strengthens.
  • Synthetic Average Cross (Thin Solid Line, Chartreuse): A synthetic cross-line reflecting the weighted ratio between the base and quote currency dynamics.
  • USD Index (Clean) (Dotted Line, LightSkyBlue): A clean US Dollar index isolated from the currencies of the active chart.
  • Interactive Anchor Line (SFA_Cross_AnchorLine): A gray dotted vertical line serving as the reference point (zero baseline for changes). You can freely drag this line across the chart with your mouse, and the indicator will instantly recalculate all metrics relative to the newly selected timestamp.
  • Dynamic Legend (ShowLegend): An informational panel in the top corner of the chart displaying currency names, active color indicators, and exact current values for each line on the latest bar.

3. Input Parameters

Core Calculation Settings

ParameterTypeDefault ValueDescription
SmoothLengthint3Smoothing period for the calculated indices.
DefaultBackBarsint200Initial offset for the vertical anchor line (in bars back from the current bar) upon first launch.

Display & Inversion Modes

ParameterTypeDefault ValueDescription
InvertQuoteboolfalseInverts the quote currency line relative to the anchor point. Useful for visualizing inverse correlation.
IninvertUsdboolfalseInverts the USD Index display line.
ShowBasebooltrueEnables or disables the base currency index line.
ShowQuotebooltrueEnables or disables the quote currency index line.
ShowAvgboolfalseEnables or disables the synthetic average cross line.
ShowUsdbooltrueEnables or disables the independent USD Index line.

Line Width & UI Settings

ParameterTypeDefault ValueDescription
BaseWidthint2Line width for the base currency index.
QuoteWidthint2Line width for the quote currency index.
AvgWidthint1Line width for the synthetic cross line.
UsdWidthint1Line width for the USD Index.
ShowLegendbooltrueToggles the informational legend overlay in the chart corner.

4. Key Features

  • Automatic Symbol Resolution: The algorithm automatically detects broker-specific symbol naming conventions (such as prefixes or suffixes like EURUSD.ecn), verifies the availability of direct and indirect pairs in Market Watch, and adjusts the quote direction for each pair in the basket accordingly.
  • Journal Statistics Logging: Every time the anchor line is moved, the indicator calculates and outputs a detailed analytical breakdown for the selected timeframe to the MetaTrader 5 Experts log:
    • CORR(Cross): Pearson linear correlation coefficient between the respective index and the synthetic cross line.
    • BETA(USD): Sensitivity/volatility coefficient (Beta) of the index relative to the US Dollar.
    • BASKET: The exact structure of the automatically generated currency basket, listing all participating symbol pairs (including inverted flags).