Well so error 4066 is a typical problem for MTF indusers, the terminal has not pumped the data of other TFs need to check for integrity of other TFs data.
Take a closer look at the code and what I have written before giving advice.
The code has a check for errors and a check for empty data. And when a function returns incorrect data without an error, it is an error!
Take a closer look at the code and what I have written before giving advice.
The code has a check for errors and a check for empty data. And when a function returns incorrect data without an error, it is an error!
Maybe I missed something and show me where you check integrity of history, for example, inCheckCurrentHourOpenTime() procedure
What do you mean by story integrity?
I'm talking about the fact that there is a check for errors when retrieving history values. There is a check in every function. Here it is:
//--- Проверяем, получено ли время открытия часового бара if(tempHourOpenTime==0 || err!=0) // Если время бара не получено return(false); // Возвращаем ложь
I.e. if zero value or error is received - time is not written to global variable. Do you think it's not enough?
The point is that the SeriesInfoInteger() function first returns an error but on the next run it returns NO! And it does not return the correct value either!SeriesInfoInteger() returns only information for a certain query, in this case we are asking to return the last known bar open time in the history by symbol and period. There is no error here, what was the latest at the moment is what it returned. I will show you how to check the integrity of the history.
SeriesInfoInteger() returns only information for a certain query, in this case we are asking to return the last known bar opening time in the history by symbol and period. There is no error here, what was the latest at the moment is what it returned. I will get to the PC and show you how to check the history integrity.
You mean there's no error here!? Then why's it giving out "fake" error codes? It says the history is OK where it's not...
What do you mean there's no error here!? Then why is it giving out 'fake' error codes? It says the history is OK where it's not...
Once again, this function doesn't check the integrity of the history! It returns the information it could find in it. In this particular case, it found the hour bar that was requested when the terminal was shut down. The rest of the history has not been loaded yet.
To check if the history of a given TF is paging in completely, just use a function:
bool IsTFDataReady(ENUM_TIMEFRAMES eTF) { ResetLastError(); iTime(NULL, eTF, 1); return GetLastError() == ERR_NO_ERROR; }
If the function returns false, the data for the requested TF is incomplete. Otherwise it is complete.
Once again, this function does not check the integrity of the story! It returns the information it was able to find in it. In this case, it found the hour bar that was requested when the terminal was switched off. The rest of the history has not been loaded yet.
Once again. It's not mentioned anywhere. That's first of all. Secondly, then why is it misleading by first showing error code 4066 and then not?
To check if the history of a given TF is paging in completely, just use a function:
If the function returns false, the data for the requested TF is incomplete. Otherwise it is complete.
Have you checked it in the timer? Do you see I have commented out lines? I checked this function, it didn't show any errors at all and also showed incorrect data. I'll check it again.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Objective: When starting the indicator, get the current data in the timer: the opening time of the weekly, daily and hourly bar. Then write them in global variables for further use. The current timeframe is М1.
Implementation: We obtain the bar times using the SeriesInfoInteger() function.
Result: As a result, if the terminal LASTED running for several hours, for example, it was off for the night, we get such a result at its first (one day) start:
As you can see, the data retrieval time is 2018.09.21 11:11, and for that time we get the opening time of the day = 2018.09.20 (although it should be 2018.09.21) and the opening time of the hour = 2018.09.20 16:00 (although it should be 2018.09.21 11:00). And the time returned by the terminal is nothing but the data at the time it was last closed. I.e. the data is cached and returned regardless of the fact that the terminal was shut down. And I understand if error #4066 would be returned every time (requested historical data in update state) until the data is updated, but no, it is ERROR data that is returned! This error is only returned once and then you can live with it. There is a clear caching error. I ask developers(@Slava) to pay attention to it!
I repeat. Erroneous data will appear if it is requested in the timer!
Terminal version: x64, 1090.