I've compiled your code using full optimization with build 3337 are here is the result:
2022.07.17 14:23:48.258 test (UsaInd,M1) wrong 63.00000 ORDER_TYPE_BUY
2022.07.17 14:23:48.259 test (UsaInd,M1) correct ORDER_TYPE_BUY 63.00000
void OnStart() { double margin = 63.0; ENUM_ORDER_TYPE otype = ORDER_TYPE_BUY; PrintFormat("wrong %s %s", StringFormat ("%0.5f", margin), EnumToString(otype)); PrintFormat("correct %s %s", EnumToString(otype), StringFormat ("%0.5f", margin)); }
You have tried to compile with no optimizations ?
I've compiled your code using full optimization with build 3337 are here is the result:
2022.07.17 14:23:48.258 test (UsaInd,M1) wrong 63.00000 ORDER_TYPE_BUY
2022.07.17 14:23:48.259 test (UsaInd,M1) correct ORDER_TYPE_BUY 63.00000
You have tried to compile with no optimizations ?
Thanks for your answer.
I tried both modes: full optimization and no optimization. It does not work correctly in both modes.
Strange, is'nt it?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
today I stumbled across a very strange (or incorrect?) behaviour of the functions PrintFormat and/or StringFormat. Please see the following script:
I get the following output:
Of course I expect
in the first output line.
What I'm doing wrong??
An auxiliary solution would be
But honestly I want to understand what is wrong here.
I use MT5 version 3360.
Thanks for every answer,
Matthias