Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

U.S. dollar index

TheUS Dollar Index (USDX, DXY) is a measure of the value of the US dollar relative to a basket of six major world currencies. It is calculated as a weighted geometric mean of the dollar's exchange rates against these currencies:

  • EURUSD (euro) - weight -0.576
  • USDJPY (Japanese Yen) - weight 0.136
  • GBPUSD (British pound) - weight -0.119
  • USDCAD (Canadian dollar) - weight 0.091
  • USDSEK (Swedish krona) - weight 0.042
  • USDCHF (Swiss Franc) - weight 0.036

Calculation formula:

USDX = 50.14348112 × EURUSD^(-0.576) × USDJPY^(0.136) × GBPUSD^(-0.119) × USDCAD^(0.091) × USDSEK^(0.042) × USDCHF^(0.036)

The coefficient 50.14348112 is the historical base and the degrees are the weights of the currencies in the basket.

This service implements data flow for a synthetic instrument - dollar index. It creates a custom symbol (USDX.synthetic), calculates its price based on current currency quotes from the basket, updates bars and ticks. It works in an infinite loop, updating data every tenth millisecond.


    You can read more about this Service in the article"Dollar Index and Euro Index Charts - an example of the Service in MetaTrader 5"

    When launched, the service automatically creates a synthetic symbol of the dollar index (USDX.synthetic) based on the quotes of the currency basket, opens its chart and updates ticks and bars of this instrument.
    The user can analyse the chart of this index, use it in indicators and test strategies. The service is designed to assess the strength of the dollar and build trading systems based on it.

    63678

    Best MetaTrader Indicators + Profitable Expert Advisors