Download MetaTrader 5

Indicator cannot access other pairs hist data/ charts not refreshing

To add comments, please log in or register
Proximus
760
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!

Keith Watford
Moderator
10566
Keith Watford  
What does the Experts log tell you?
Simon Gniadkowski
Moderator
18024
Simon Gniadkowski  
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.
Proximus
760
Proximus  
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?

Proximus
760
Proximus  
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.
Proximus
760
Proximus  
Any help please?
qjol
3243
qjol  

RaptorUK already answered your question, deal with the error 4066

whroeder1
15572
whroeder1  
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
To add comments, please log in or register