Indicator cannot access other pairs hist data/ charts not refreshing

 

I have an indicator which looks at 15 different pairs at the same time to find a trend.

It works perfectly on H1 timeframe, however on any other timeframe it is blank.I suppose it is because there is no historical data on that pair downloaded.

But why it doesnt automatically download it from the broker, like if there is a MACD or Stochastic it updates the price as it comes, so why not do the same on other pairs aswell?

I tried using RefreshRates() but it still doesnt work.


Can the automatic download of price data from the broker be done in MQ4 code or this is a technical problem of the MT4 that it doesnt update price from broker data?

I`m aware that it can be done manually, by opening the charts but i`m not going to open 15 charts just for the sake of updating data from them, so i want an automatic method please.

Help please!

 
What does the Experts log tell you?
 
Proximus:

I have an indicator which looks at 15 different pairs at the same time to find a trend.

It works perfectly on H1 timeframe, however on any other timeframe it is blank.I suppose it is because there is no historical data on that pair downloaded.

But why it doesnt automatically download it from the broker, like if there is a MACD or Stochastic it updates the price as it comes, so why not do the same on other pairs aswell?

I tried using RefreshRates() but it still doesnt work.


Can the automatic download of price data from the broker be done in MQ4 code or this is a technical problem of the MT4 that it doesnt update price from broker data?

I`m aware that it can be done manually, by opening the charts but i`m not going to open 15 charts just for the sake of updating data from them, so i want an automatic method please.

Help please!


Search for error 4066 and do plenty of reading . . .  unless of course you are talking about running in the Strategy Tester ?  in that case you have to make sure you have the data available.
 
GumRai:
What does the Experts log tell you?

2014.07.26 13:20:11.645    zero divide in 'TREND-METER.mq4' (133,57)
2014.07.26 13:20:11.589    TREND-METER EURUSD,Daily: initialized


Probably because of the lack of historical data in that pair.As it works perfectly on H1,

However i ask that is it possible to automatically download broker historical data with code, instead of opening up 15 charts at once to have updated data?

 
RaptorUK:

Search for error 4066 and do plenty of reading . . .  unless of course you are talking about running in the Strategy Tester ?  in that case you have to make sure you have the data available.

Its not strategy tester its on real time demo , running my indicator.
 
Any help please?
 

RaptorUK already answered your question, deal with the error 4066

 
qjol: RaptorUK already answered your question, deal with the error 4066
That, and don't assume that a index on the current chart is the same on any of the others. Use iBarShift
Reason: