Watch how to download trading robots for free
Find us on Facebook!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Published by:
Artyom Trishkin
Views:
2198
Rating:
(8)
Published:
USD_Index.mq5 (3.01 KB) view
CurrencyIndex.mqh (51.64 KB) view
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

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.

    Translated from Russian by MetaQuotes Ltd.
    Original code: https://www.mql5.com/ru/code/63678

    Delete Trading History Delete Trading History

    The script removes all autotrading icons from the current chart

    Find Pin Bars Find Pin Bars

    The indicator searches the chart for Price Action patterns "Pin Bar" and puts icons on the bar with the found pattern.

    Zigzag Custom Timeframe Zigzag Custom Timeframe

    It's the classic zigzag with a timeframe input to display a HTF zigzag on a LTF chart

    Consolidation Consolidation

    This indicator calculate count of one direction movement in selected period.