iHighest error 4073 No history data

 

Hi

This line of code in an EA in mql4 is giving No history data error;

iHighest(mSymbol, mPeriod, MODE_HIGH, barsGroup, i);

Reading up on https://docs.mql4.com/series/copyrates

Is this the only way to fix it? Since CopyRate gets the data from the server into an array. But then do I have to make up my own function to simulate what the iHighest does out of the box?

or there is a simpler solutions?


Thanks

CopyRates - Timeseries and Indicators Access - MQL4 Reference
CopyRates - Timeseries and Indicators Access - MQL4 Reference
  • docs.mql4.com
Gets history data of MqlRates structure of a specified symbol-period in specified quantity into the rates_array array. The elements ordering of the copied data is from present to the past, i.e., starting position of 0 means the current bar. If you know the amount of data you need to copy, it should better be done to a statically allocated...
 
iHighest(mSymbol, mPeriod, MODE_HIGH, barsGroup, i);

What are the 3 variables and where do they get assigned a value?

 
Keith Watford:

What are the 3 variables and where do they get assigned a value?

Are you saying that the problem is not in the lack of data but the value of the variables? Ok. I will debug to check what their values are on run time with a Print statement. thx

 
On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
          Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4
 
William Roeder:
On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
          Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4

Thanks William

After reading the thread and understanding it "hopefully". I gather that by using 

iTime(symbol, period, 0);

the data will be downloaded from the server. Right?

So basically, if I chnage the "0" to whatever shift "100 for the last 100 bars" then the mql4 code of the ea will have the data to work with. Right?

Thanks for that, else please correct me if my understanding is wrong, or affirm for me to know that you read my post :)

-------------------

Oops, I just read https://docs.mql4.com/series/itime

"If local history is empty (not loaded), function returns 0."

Well then, the problem still remains, and the link you povided did not help me much unless I am missing the point.

So, how can I get the data from the server for my ea to loop over some symboles and timeFrames for the purpose of backtesting?

iTime - Timeseries and Indicators Access - MQL4 Reference
iTime - Timeseries and Indicators Access - MQL4 Reference
  • docs.mql4.com
Time value for the bar of specified symbol with timeframe and shift. If local history is empty (not loaded), function returns 0. To check errors, one has to call the GetLastError() function.
 
samjesse: the data will be downloaded from the server. Right?

The data will start to be downloaded.

Reason: