Features of the mql5 language, subtleties and tricks - page 254

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
Forum on trading, automated trading systems and testing trading strategies
Features of mql5 language, subtleties and techniques of work
Vladislav Boyko, 2024.04.18 02:29
Maximum optimisation:
No optimisation:
The performance of imported functions cannot depend on the selected compiler settings.
Forum on trading, automated trading systems and testing trading strategies
Features of mql5 language, subtleties and techniques of work
amrali, 2024.04.18 01:50 PM
Put this summand into the array.
lookup tables are always faster than switch (linear search).
Alternative.
The encoding of year and month components into a timestamp was the main challenge.
Other components of MqlDateTime struct are trivial to claculate. (multiply by seconds)
Forum on trading, automated trading systems and testing trading strategies
Peculiarities of mql5 language, subtleties and techniques of work
fxsaber, 2024.04.16 00:35
Alternative.
A slightly improved mechanism for applying optimisation produced this. I think this is the fastest calculation.
A slightly improved mechanism for applying optimisation produced this. I think this is the fastest calculation.
Very fast.
To the piggy bank of algorithms on the topic.
Check out this implementation.
I did. Checked it.
Surprisingly, my variant, whose logic was describedhere, turned out to be the fastest. The ported function from C++ library turned out to be the slowest.
test result:
but it is more reasonable to use this variant to use the saved previous values in case the requested day is the same. Therefore, the function will work even faster.
Forum on trading, automated trading systems and testing trading strategies
Features of mql5 language, subtleties and techniques of work
Nikolai Semko, 2024.04.19 09:23
Forum on trading, automated trading systems and testing trading strategies
Peculiarities of mql5 language, subtleties and techniques of work
fxsaber, 2024.04.16 12:46
x64:
To the piggy bank of algorithms on the topic.
I checked days_from_civil() and epoch_days_fast() from the links you sent.
These are not the fastest (probably the MQL5 compiler).