Download MetaTrader 5
To add comments, please log in or register
Having questions to the author of an article? Discuss them on the Forum!
Proximus
756
Proximus 2014.07.25 06:36 

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
8026
Keith Watford 2014.07.25 07:35  
What does the Experts log tell you?
Simon Gniadkowski
Moderator
17963
Simon Gniadkowski 2014.07.25 07:53  
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
756
Proximus 2014.07.26 12:22  
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
756
Proximus 2014.07.26 12:23  
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
756
Proximus 2014.07.28 14:02  
Any help please?
qjol
3243
qjol 2014.07.28 17:46  

RaptorUK already answered your question, deal with the error 4066

whroeder1
13656
whroeder1 2014.07.29 12:01  
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