So it's not me who missed the range of the array, but the long-suffering history is somehow not always supposedly loaded. I always thought that the history is loaded on the left and might be missing when it's not fully loaded. But not enough history on the right side (new bars) - this is nonsense to me! Besides, I have ArraySetAsSeries=false, if it matters at all.
So this is not the program code, but the result of the Print in the Terminal Log. And here is the code itself:
So it's not me who missed the range of the array, it's the long-suffering history that somehow doesn't always supposedly get loaded. I always thought that the history is loaded on the left side and may not be enough when it's not fully loaded. But not enough history on the right side (new bars) - this is nonsense to me! Besides, I have ArraySetAsSeries=false.
I have the output stringArr[0] specifically commented out (see above), because when I try to output it to the Journal it doesn't get to the 4401 error message, but ends up outputting an "array out of range" error.
Ошибки компиляции - Коды ошибок и предупреждений - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
My output stringArr[0] is specially commented out (see above), because when I try to output it to Journal it does not get to error message 4401, but ends up with "array out of range" error.
It's craziness is thathttps://www.mql5.com/ru/docs/series/timeseries_access mentions Sleep() in the article about loading history in the code. But help for Sleep() says: "Sleep() function cannot be called from custom indicators, because indicators are executed in the interface thread and it should not slow it down". It turns out that I need to load the history in an indicator.
Организация доступа к данным - Доступ к таймсериям и индикаторам - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
It's craziness is thathttps://www.mql5.com/ru/docs/series/timeseries_access mentions Sleep() in the article about loading history in the code, but the help for Sleep() says: "Sleep() function cannot be called from custom indicators, because indicators are executed in the interface thread and it must not slow it down". It turns out that I need to load the history in the indicator.
Well, make an exit if the data is not copied
int c=CopyTime(_Symbol,tf,0,1,Arr);
if(c<1) return;
At the next tick everything will be copied and the code will work correctly
Hello, I'm testing my robot, after finishing testing I saw a lot of fields with requotes in the Log, what do these message stacks mean and what can I add to the code to prevent them from appearing? Thank you, Happy New Year!
Caught the error after all, quote from the reference:
Printed in the Journal - got it:
What do I do with it now, where do I go? Am I a bad hand or...?
Are you sure it's supposed to be an assignment
and not a comparison?
Surely it should be an assignment
and not a comparison?
So this is not the program code, but the result of the Print in the Terminal Log. And here is the code itself:
So it's not me who missed the range of the array, but the long-suffering history is somehow not always supposedly loaded. I always thought that the history is loaded on the left and might be missing when it's not fully loaded. But not enough history on the right side (new bars) - this is nonsense to me! Besides, I have ArraySetAsSeries=false, if it matters at all.So this is not the program code, but the result of the Print in the Terminal Log. And here is the code itself:
So it's not me who missed the range of the array, it's the long-suffering history that somehow doesn't always supposedly get loaded. I always thought that the history is loaded on the left side and may not be enough when it's not fully loaded. But not enough history on the right side (new bars) - this is nonsense to me! Besides, I have ArraySetAsSeries=false.Reads an empty array with nothing in it?
Try this
Reads an empty array with nothing in it?
Try this
I have the output stringArr[0] specifically commented out (see above), because when I try to output it to the Journal it doesn't get to the 4401 error message, but ends up outputting an "array out of range" error.
...I'll smokehttps://www.mql5.com/ru/docs/series/timeseries_access for now, but bloating my code with this code is creepy...My output stringArr[0] is specially commented out (see above), because when I try to output it to Journal it does not get to error message 4401, but ends up with "array out of range" error.
Forum on trading, automated trading systems and trading strategies testing
Bugs, bugs, questions
Vitaly Muzichenko, 2020.12.31 13:06
Reads empty array with nothing in it?
Yes, the array turns out to be empty, i.e. no new bars are copied into it.
Yes, the array turns out to be empty, i.e. no new bars are copied into it.
This is the case with the first query
It happens at the first request
It's craziness is thathttps://www.mql5.com/ru/docs/series/timeseries_access mentions Sleep() in the article about loading history in the code. But help for Sleep() says: "Sleep() function cannot be called from custom indicators, because indicators are executed in the interface thread and it should not slow it down". It turns out that I need to load the history in an indicator.
It's craziness is thathttps://www.mql5.com/ru/docs/series/timeseries_access mentions Sleep() in the article about loading history in the code, but the help for Sleep() says: "Sleep() function cannot be called from custom indicators, because indicators are executed in the interface thread and it must not slow it down". It turns out that I need to load the history in the indicator.
Well, make an exit if the data is not copied
At the next tick everything will be copied and the code will work correctly
Hello, I'm testing my robot, after finishing testing I saw a lot of fields with requotes in the Log, what do these message stacks mean and what can I add to the code to prevent them from appearing? Thank you, Happy New Year!