Referencing Bar Data From Multiple Symbols

 
Is there a way to reference bar data (open/high/low/close) from other symbols (charts) within MetaQuotes. For example, let's say I'm working on an algorithm to trade USDJPY and I want to reference the last close price for EURJPY.

Likewise, is it possible to do so with current spread data (referencing the current bid/ask for other symbols)?

I should point out that I need this info for both realtime and for historical testing (so MarketInfo() may not work with historical chart data...I think. You tell me.)

Thanks
 
JRS,

In order to get bar data you should use de "indicators" iLow , iHigh, iOpen, iClose , iTime.
In the example below you will see in the "expert" tab the Low value and the time for EURUSD 30 days back.
This information must be in the local history.


Print( iLow("EURUSD", PERIOD_D1, 30 ) );
Print( TimeToStr( iTime("USDCHF", PERIOD_D1, 30) ) );


Hope this help

Matias Romeo
Custom Metatrader Systems
matiasdotromeoatgmail.com
 
When I try to validate the compiler doesn't recognize iLow/iHigh.

I can't find the iLow, iHigh, etc. functions under indicator in the dictionary.
 
JRS,

iLow/iHigh are only available in MT4.
Sorry.

Matias Romeo
Custom Metatrader Systems
matiasdotromeoatgmail.com
Reason: