Using data from another symbol in EA code

 

Hi, I've recently started learning how to code in MQL5 (in fact in any coding language!), so apologies if there is a simple answer!

I'm trying to write an EA to work on Dollar pairs, and want to use price data from the Dollar Index (DXY) within the code.

Effectively, I want the code I'm writing for trading in either USD/JPY, GBP/USD or EUR/USD to be able to check if the dollar index closed up or down in the previous trading day, is this possible?

 
JDavey2022: Hi, I've recently started learning how to code in MQL5 (in fact in any coding language!), so apologies if there is a simple answer! I'm trying to write an EA to work on Dollar pairs, and want to use price data from the Dollar Index (DXY) within the code. Effectively, I want the code I'm writing for trading in either USD/JPY, GBP/USD or EUR/USD to be able to check if the dollar index closed up or down in the previous trading day, is this possible?

Yes, that is totally possible. Please read ... Documentation on MQL5: Timeseries and Indicators Access

Documentation on MQL5: Timeseries and Indicators Access
Documentation on MQL5: Timeseries and Indicators Access
  • www.mql5.com
Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: