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
Sure you can load it recursively, it's not related to the topic.
I see, it's not necessary, because the indicator is already in place....
Bug in MQL string() function. Wrong conversion of double -> string
Build 3182 but this is not specific to this build, it's an old one.
A bug is found in string() function where wrong conversion of double -> string.
If you convert an arbitrary double-precision floating-point number to a decimal string, and then convert that back to floating-point, you should recover the original floating-point number. In other words, the conversion will round-trip.
The string() function may return wrong string representation of double numbers that cannot round-trip into the same numeric value.
This also affects any implicit cast inside Print(), Alert(), Comment(), FileWrite().
This a sample script to reproduce the bug:
Thank you for your report.
It will be fixed soon
Reported in 2019. Confirmed recently by @Anatoli Kazharski
Forum on trading, automated trading systems and testing trading strategies
New version of the MetaTrader 5 platform build 2007: Economic calendar, MQL5 programs as services
Alain Verleyen , 2019.04.16 03:50
Build 2007/2025.
It doesn't seem to be possible to change the "Accept" header in a WebRequest (it works with mql4).
The attached code should return a JSON response, like so:
{ "responseParameters": { "doui_setResponseParameters": [ "8AA8D0CD6A05153A016A16735AF94E0E"]}}
But the response is an HTML file because the server needs an "Accept: application/json" header. I know this because it works with Postman for example.
When inspecting HTTP sent by MT5 with Wireshark, the "Accept" header is always:
To accept: * / *
Is this a bug or am I missing something?
Thank you for your report.
It will be fixed soon
IMHO a "shortest" round-trip conversion needs to be considered.
Thanks.
Build 3180 but this is not specific to this build, it's an old one.
On indicators, MT5 can set automatically a level "0" depending of the buffer values. There is no way to disable this behaviour or to customize the level line drawing.
Thank you for your report.
It will be fixed soon
build 3194: string() function bug is fixed, finally.
I think this was done by adopting a brute force approach through trial of rounding to at most 17 significant decimal digits to guarantee round-tripping.
Finally, the output of double numbers from Print(), Alert(), Comment() and FileWrite() is much clear and less-confusing.
As a result, if the input number is rounded (or parsed from a human-typed decimal string), you will not see those extra decimal digits printed. In the case, there are many digits after the decimal point, it gives you a hint that the number is NOT rounded as expected, in the first place.
This 1:1 mapping will clear much of the confusion on the forum regarding printing (double->string conversion) of floating point numbers .
Thanks MetaQuotes.
Edit:
Now what you see is what you get.
This a test script to reproduce the bug: