Download MetaTrader 5

accessig offline charts from EA

To add comments, please log in or register
Ingvar Engelbrecht
4505
Ingvar Engelbrecht  

Is it possible to use offline data in an EA. Range bars and similar  are often created as offline charts.

To develop multicurrency EA:s using rangebars  I  would have to use offline charts as the primary input since range bar creators all seem to use offline charts.

MT4.

i got a suggestion that it should work if the offline chart is open.

Here is what I did:

 - Created a range bar chart for EURUSD and called it "M3"  Worked OK
 - I kept it open

Is started a test EA on USDJPY.  I used iRSI, iBands and iMACD explicity specifying "EURUSD"  and PERIOD_M3 to obtain values from these indicators and printed them for the last closed bar.

Voila!   Correct values for the indicators. Matched values I got by applying these indicators to the range bar chart.


I also made a CopyRates to obtain the last close specifying symbol and timeframe.  Not correct. The close value I got was not from  "1"  (last close)  I found that value 7 bars earlier. Hm.That might just be coincidence

Strange.

So it works. Almost.

Ingvar Engelbrecht
4505
Ingvar Engelbrecht  

It works.

User Error. Forgot to set

ArraySetAsSeries(rates,true);

To add comments, please log in or register