Features of the mql5 language, subtleties and tricks - page 232
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
This is a bad explanation, because
Another way to explain the meaning of DBL_EPSILON:
DBL_EPSILON is just the gap size between consecutive doubles in [1,2).
https://www.exploringbinary.com/the-spacing-of-binary-floating-point-numbers/
https://en.wikipedia.org/wiki/Machine_epsilon
To better understand DBL_EPSILON, consider incrementing a floating-point counter:
If the initial value of the counter is 1.0, the step size (epsilon) of the counter will be 2.220446049250250313e-16 (DBL_EPSILON) ≈ 2 at the 16th decimal place.
/* 1.0000000000000002 1.0000000000000004 1.0000000000000007 1.0000000000000009 1.000000000000001 1.0000000000000013 1.0000000000000016 1.0000000000000018 1.000000000000002 1.0000000000000022 */
If the initial value of the counter is 1024, the step size (epsilon) of the counter will be 2.2737363675443232321e-13 (1024 * DBL_EPSILON) ≈ 2 at the 13th decimal place.
/* 1024.0000000000002 1024.0000000000005 1024.0000000000007 1024.000000000001 1024.0000000000011 1024.0000000000014 1024.0000000000016 1024.0000000000018 1024.000000000002 1024.0000000000023 */
If the initial value of the counter is 4503599627370496 (2^52), the step size of the counter will be 1.0 (2^52 * DBL_EPSILON)= 1. At this range, a double behaves like an integer counter, no fractions could be representable.
/* 4503599627370497.0 4503599627370498.0 4503599627370499.0 4503599627370500.0 4503599627370501.0 4503599627370502.0 4503599627370503.0 4503599627370504.0 4503599627370505.0 4503599627370506.0 */
You can see that the smaller numbers have smaller gaps between them, and the larger numbers have larger gaps between them.
Therefore, DBL_EPSILON is the relative error rate. relative means relative to the magnitude of the number.
at 1.0, the absolute error = 1 * 2.2204460492503131e-016 (DBL_EPSILON).
at d, the absolute error ≈ d * DBL_EPSILON.
(DBL_EPSILON is a reference rate at 1.0, something like the bank's annual interest rate, and it is equal to 2^-52).
A side-note: if you try to print 1024.0000000000003, it will print 1024.0000000000002 instead (rounding to the nearest representable number), because 1024.0000000000003 is not a representable number (non-existing fp number).
This is called a representation error:
The previous/next representable numbers are reached at through bit manipulation (enum as before: DoubleAdvance(value, -1)) or by using DBL_EPSILON:
DBL_EPSILON is mainly used to estimate (or correct) fp round-off errors after mathematical operations on doubles (numerical analysis):
|true result - fp result| / true result <= DBL_EPSILON
Does the OnTester() call get disabled in the MT5 tester when there is a genetic optimisation algorithm and NOT a custom optimisation criterion?
I think not. But I would like to... Preferably without config parsing.
PS. CARAUL!!! Everything is gone! At each pass of optimisation (should/shouldn't) - OnTester() is called, which can greatly increase the total time of optimisation!
Help who can... )))))
In my search I came across an interesting undocumented function
you can hide input comment for a dialogue box
original post here
https://www.mql5.com/ru/forum/1271#comment_9019
In my search I came across an interesting undocumented function
you can hide input comment for a dialogue box
original post here
https://www.mql5.com/ru/forum/1271#comment_9019
In Tester, the History table is overwritten only in two cases.
Forum on trading, automated trading systems and testing of trading strategies
Errors, bugs, questions
fxsaber, 2023.07.19 19:10
Forum on trading, automated trading systems and testing trading strategies
Bugs, bugs, questions
fxsaber, 2023.07.19 18:55
HistoryOrderGetTicket, PositionGetTicket, OrderGetTicket - similar.