How to use DOLLAR INDEX information from another source on my ea

 
I want to be able to use the dollar index in my ea and want to see the best way to do so. 

I use Oanda and with Oanda there is no dollar index to trade. Other brokers or trading view have the dollar index. Let’s say my strategy on eur usd was to not take longs unless we were above the 200 day moving average on the dollar index.

What is the best way to do this ?
 
GEORGE E SOLOMOS:
I want to be able to use the dollar index in my ea and want to see the best way to do so. 

I use Oanda and with Oanda there is no dollar index to trade. Other brokers or trading view have the dollar index. Let’s say my strategy on eur usd was to not take longs unless we were above the 200 day moving average on the dollar index.

What is the best way to do this ?

You can create a custom symbol (on mt5) if you know the formula for the index

-----

This is the formula : 

50.14348112*(pow(EURUSD,-0.576))*(pow(USDJPY,0.136))*(pow(GBPUSD,-0.119))*( pow(USDCAD,0.091))*(pow(USDSEK,0.042))*(pow(USDCHF,0.036))

The symbols in the formula must be in the market watch (selected)

 
Lorentzos Roussos #:

You can create a custom symbol (on mt5) if you know the formula for the index

-----

This is the formula : 

The symbols in the formula must be in the market watch (selected)

Thank you for the response. I am using mt4 and everything is written and coded in mt4. Is there anyway to do this on mt4 ? If not any other ideas ? Like getting the data from somewhere else and the ea just reads it from an external source ?
 
GEORGE E SOLOMOS #: Thank you for the response. I am using mt4 and everything is written and coded in mt4. Is there anyway to do this on mt4 ? If not any other ideas ? Like getting the data from somewhere else and the ea just reads it from an external source ?

Your topic has been moved to the section: MQL4 and MetaTrader 4 — In the future, please consider which section is most appropriate for your query.

 
GEORGE E SOLOMOS #:
Thank you for the response. I am using mt4 and everything is written and coded in mt4. Is there anyway to do this on mt4 ? If not any other ideas ? Like getting the data from somewhere else and the ea just reads it from an external source ?

Yes you can do it in mt4 and "internalize" the index and its MA200 . If you care about the close being over or under its ma200 then you can go that route , if you are interested in high+lows of usdx too there will be a deviation from the "proper" usdx as the high/low points of the underlying assets have no time associated with their prices so you would be assuming all the highs of the assets came in at the same time which is highly unlikely.

If you have an external source with an API you can integrate it . But with these feeds you don't get a disclosure of how the usdx is calculated . For all you know even trading view's chart may be vulnerable to the above issue . 

You can also have an mt5 instance communicate with an mt4 instance feeding in the new bars of the usdx to the ea internally .

Now when it comes to charting , if you want to chart this as a normal chart on mt4 you will have to look into offline charts or (if you just want MAs and price bars) fashion a custom charting solution that is a chart inside the chart .

So shifting everything to mt5 might be easier (depending on the size of the ea of course)

Reason: