Features of the mql5 language, subtleties and tricks - page 56
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Have you measured the performance? I'm curious how much it will slow down the performance. Especially with custom indicators.
I have not measured it, but it should not be slower than in MT4.
MeasurementThe result is
One third of a microsecond to verify. It means that a single run for every 10 million ticks will slow down by three seconds.
Measurement
Strange that you didn't compare creating the handle + getting the value in the loop with your original version, that's the difference that's interesting.
It's strange that you didn't compare creating a handle + getting a value in a loop with your original version, that's the difference that's interesting.
Because the values are taken from the same handle. iMA with the same parameters always returns the same handle.
In MQL5 it is quite acceptable to write it like this
I.e. "create" a handle on every tick. New indicator entities will not be created, the time will be wasted only on the comparison of the iMA input parameters with those indicators that were running on the previous ticks. In other words, it's the same as in MT4.
This is an interesting design.
Please check the speed of handle creation in OnInit with this approach.
Please check the speed with Handle creation in OnInit, with this approach.
Forum on trading, automated trading systems and strategy testing
Peculiarities of mql5 language, subtleties and tricks
fxsaber, 2017.10.05 09:09
A single run for every 10 million ticks will slow down by three seconds.
This is compared to your option.
How can I replace standard OrderCalcProfit() and OrderCalcMargin() so that the functions are cross-platform? It seems, that it already was somewhere, but I can't find it here - maybe I was sleepy... But I must have woken up within an hour of searching :)
How can I replace standard OrderCalcProfit() and OrderCalcMargin() functions so that they would be crossplatform? It seems, that it already was somewhere, but I can't find it here - maybe I was awake... But I must be awake after an hour of searching :)
https://www.mql5.com/ru/search#!keyword=myordercalcmargin&module=mql5_module_forum
https://www.mql5.com/ru/search#!keyword=myordercalcmargin&module=mql5_module_forum
:)
SymbolInfoMarginRate() is not in 4. The question was formulated as follows:
Forum on trading, automated trading systems and trading strategies testing
Peculiarities of mql5, tips and tricks
Artyom Trishkin, 2017.10.06 06:36
How can I replace standard OrderCalcProfit() and OrderCalcMargin() so that functions are cross-platform? It seems, that it already was somewhere, but I cannot find it here - can not sleep... But after an hour of searching I should have woke up :)
It's a gift, not a language opportunity.
A gift, not a language opportunity
A gift in the form of an elusive runtime error
How is ::CopyTicks better than Copyticks ?
And why is the result always -1. Such errors (4006) should be reported at compile time