Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1857
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
There have been complaints that this procedure takes a lot of CPU time.
The normalisation of the calculated SLs and TAs takes twice as long. But I wouldn't say it has that much impact on optimisation and even less on robot testing.
The documentation says in black and white to normalize the calculated levels! And what could be the "author's intent"? What is not to normalize SL and TP? I'm not going to argue with you because the facts are obvious here!
If this is a question, then get the ticket of the first, select the first and subsequent ones which have the ticket !=first.
It takes twice as long to normalise the calculated SLs and TAs. But I wouldn't say it has that much of an impact on optimisation and even less on robot testing.
It does, and there have been questions on this forum about simplifying this procedure.
I don't know of a case where received prices that aren't normalized caused an error.
For reference:
And what could be the "author's intention" in this case? That not to normalize SL and TP? I'm not going to argue with you because the facts are obvious!
An afterthought might be rounding. In theory this is not done, but this way in the case of rounding to fewer digits , in case the prices will be correct for SL and TP, will work. So you have to find out what is intended in any case.
I tried to solve it myself, roughly add in the code of this indicator, but it doesn't work. Although it compiles and no errors.
Maybe we should use iCustom and handle indicator?
If you try to identify the problem and then describe in more detail what exactly it is that you can't do, then the probability of getting an answer will be much higher.
It takes twice as long to normalise the calculated SLs and TAs. But I wouldn't say it has that much of an impact on optimisation, let alone robot testing.
Not only that, but some people neglect such simple checks as
thinking it may consume a lot of CPU time :)
But actually it is functions like ObjectCreate and ObjectDelete that consume processor time. If a programmer has, say, an array of graphical objects and it is deleted and recreated on every tick, something must be done about it. While simple checks and calculations are of little time. This is why a lot of programmers are just looking in the wrong place.
It does, and there have been questions on this forum about simplifying this procedure.
I don't know who it affects or what it affects. I've never had any problems with NormaizeDouble. If anything, any code affects the speed of an application. But if everything is so critical, you may leave handlers OnTick or OnCalculate empty. In this case your application will be flying at all. :) Or rewrite functions on assembler, compile into DLL and connect them to the application.
I don't know cases when received and non-normalized prices caused an error.
But the documentation does! And you ignore the advice in the documentation. Suit yourself. That's your business. I think it's obvious and I'm not going to argue with you about it, I'll say it again!
Rounding may be an afterthought.
It's not rounding, it's cutting off everything over two decimal places.
I don't know the author's idea either. But I don't need it. I think he can figure it out on his own.
Good day
Can you tell me why the MQL4 compiler complains about the following array declaration?
input int trendSlowCountBar=9;
double MAslowTrend [trendFastCountBar];
it generates the following error:
'[' - invalid index value
I can't seem to find any restrictions on specifying a dimension in the language reference... (
input int trendSlowCountBar=9;
double MAslowTrend [trendFastCountBar];
it generates the following error:
'[' - invalid index value
I can't seem to find any restrictions on specifying a dimension in the language reference... (
That's because the size of static arrays cannot be defined by variables. You should use a dynamic array instead:
It's not rounding, it's cutting off anything over 2 decimal places
It's called rounding down.
But the documentation does! And you disregard the advice in the documentation. Suit yourself. That's your business. I think it's obvious and I'm not going to argue with you about it, I'll say it again!
Especially for you on the last page is a screenshot from the edit.
It's called rounding down.
Well, you can call it what you like :)
Especially for you, there's a screenshot from the edit on the last page.
Why would I need your screenshot if I followed the link and read:https://docs.mql4.com/ru/trading/ordersend
Not only that, but I gave you the quote above, where it says it all. And you advise me to look at some screenshot. :)
That's it. Enough of this idle chatter.