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
Sort of cooked it up. Criticism is welcome.
Since it's probably going to be an expert, then:
и:
I'm betting on that being guaranteed. At least I count on it all the time, and the problem has never arisen.
I see. Anyway, it's a touchy moment.
uncleVic
That's true. But in my case it's redundant:
As you can see, if there is an error in the tools in the last cycle in OnTick, there will be no iteration.
I see. Anyway, it's a touchy moment.
uncleVic
That's true. But in my case it's redundant:
As you can see, if there's an error in the tools in the last cycle, there won't be a single iteration in OnTick.
I don't insist. It's just that checking the result of execution is the right thing to do.
I'm not pushing it. Just checking the result of the execution is the right thing to do.
I've discovered this trick. If you run this script, it "hangs".
But if the same three lines (code) are inserted first into OnInit() function of the Expert Advisor and such EA is launched in testing mode, the results are as follows:
First, the code somehow works in testing mode.
Second, (more important), the history of the first few days of testing gets lost. Thus, in the above example, the testing was started on 2011.01.03 (as can be seen from the first two lines), but the tester immediately jumped forward by 17 days after code processing (in this case this is a line 2-3), and testing is continued without taking these 17 days into account.
resulting in a waiting period of 17.5 days.
You've just caught an arithmetic overflow in
and have been waiting for 17.5 days.
You have trivially caught an arithmetic overflow in
as a result, you have a 17.5 day wait.
I'm not arguing about "caught overflow", because I don't know :) The question is that such a situation should be suppressed either by compiler or tester with output of critical error (or in some other way). Not everyone will be meticulous about how their programs work in the absence of warnings from the terminal.
The problem is also seen in the fact that the code is placed in OnInit() first lines (i.e. before any historical data is downloaded) - but for some reason, the data of the first 17.5 days are lost.
Yep, and it works in the tester because Sleep is ignored in it.
Are you so sure that Sleep() is ignored? - Look at the difference in terminal time between lines 2 and 3.