
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Maybe the mere presence of Sleep (compared to its absence) in the code somehow affects the overall execution time, but the fact that Sleep does not count in the tester - that's for sure.
The code hangs up the terminal:
What is the reason?
The code hangs up the terminal:
What is the reason?
Is the terminal not set to Unlim?
For starters:
Isn't Unlim in the terminal settings?
the max bars are 5000. can this value be reduced?
I don't think you can do less (I'm not sure).
What does Print(count) show?
I don't think less is possible (not sure).
Well, what does Print(count) return?
in comment -1
I tried it with another symbol but it did not show up in the comment -1
REMARK: Freeze after a few sec. I start the code from int OnInit()
Yes, and it works in the tester, because Sleep is ignored in the tester.
Sleep is fully and accurately emulated in the Sleep tester.
In the example, due to arithmetic overflow when dealing with integer values, there was just a 17.5 day wait. The tester waited exactly that long.
Therefore, there is no error in the tester or in the MQL5 execution environment, but there is an obvious error made by the programmer.
Renat:
That is, there is no error of the tester or the MQL5 execution environment, but there is a clear error of the programmer.
It's quite clear.
Renat:
Sleep is emulated in the tester completely and quite accurately.
Due to the arithmetic overflow when working with integer values the wait time is 17.5 days. That's exactly how long the tester waited.
Hmm, there you go. And I mistakenly thought Sleep was just ignored.
So, for example, if I set Sleep (3 months) in Expert Advisor in testing mode, the tester would simply fast-forward the history for 3 months? - That's great.
During the waiting period the tester continues to fully emulate the trading environment, including all processing of previously placed orders. The tester in MT5 is very detailed.
in comment -1
I tried it with another symbol but it did not show up in the comment -1
REMARK: Freeze after a few sec. I will run the code from int OnInit()
Yes. We didn't even notice the elephant.
Something makes me very suspicious about this line:
ArrayMaximum
searches for the maximum item in a one-dimensional numeric array.
intArrayMaximum(
doublearray[],// array to search
intstart=0//from which index we start the search
intcount=WHOLE_ARRAY,// number of indexes to be checked
);
and in our case:
MqlRates s1[];
I think the compiler shouldn't skip this. What do you have? Not even a warning? If not, put in a request to Service Desk. Okay?