Errors, bugs, questions - page 3040
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 has been the case for a long time. mql strings really don't like null characters inside a string and in literals, in functions too.
The only normal way is to translate three strings with a terminating null into an array.
I.e. this behaviour as it is now was done intentionally some years ago. I don't know the reasons.And what function besides StringToCharArray does not work correctly with internal nulls?
For example StringToShortArray - works without errors.
StringCompare used to work incorrectly but this was fixed long ago.
As for StringLen, it does not work correctly.
Forum on trading, automated trading systems and strategy testing
Bugs, bugs, questions
A100, 2019.05.15 13:45
Just partially corrected errors .... why not!? In my memory StringLen always worked correctly (at least in x32)I don't remember exactly, at one point a string with a null inside was truncated to zero, maybe stringconcatenate, maybe with simple string operations.
Great forum, got on sending a reply this afternoon. The reply itself got lost.
Monday, middle of the afternoon...
Several terminals are minimised. However, each terminal gives alerts to its own alert window - not collapsed.
How do I know which alert window corresponds to which terminal?
Several terminals are minimised. However, each terminal gives alerts to its own alert window - not collapsed.
How can I understand which alert window corresponds to which terminal?
I don't know anything about unique terminal ID, but you can add to alertAccountInfoString(ACCOUNT_COMPANY). I don't think anyone will have several MT5 instances logged simultaneously to one and the same brokerage company, although hypothetically it could still be reasonable if one needs to sit on different accounts of the same broker. In this case (at the very least)AccountInfoInteger(ACCOUNT_LOGIN) orAccountInfoString(ACCOUNT_SERVER) might work.
I don't know anything about unique terminal ID, but you can addAccountInfoString(ACCOUNT_COMPANY) to the alert. I don't think anyone will have multiple MT5 instances logged into the same brokerage company at the same time, although hypothetically it might still be worthwhile if you need to sit on different accounts of the same broker. In this case (at the worst)AccountInfoInteger(ACCOUNT_LOGIN) orAccountInfoString(ACCOUNT_SERVER) will do.
Yes, you can put any identification data into your Alerts. But the question is about the general case.
Which function besides StringToCharArray does not work correctly with internal zeros?
For example, StringToShortArray works without errors.
StringCompare used to work incorrectly, but this was fixed long ago.
As for StringLen
You're right, changed StringToCharArray's behaviour, now it's the whole length of the string, not up to the first '\0' character
You're right, changed the behaviour of StringToCharArray, now to the full length of the string, not up to the first '\0' character
Forum on Trading, Automated Trading Systems and Strategy Testing
Errors, Bugs, Issues
A100
, 2021.05.25 00:16Result: 4:0
Expected: 0:
Then only one difference betweenStringToCharArray andStringToShortArray remains:
Made the behaviour the same.
Additionally: in the near future, arrays and strings will be supplemented with methods, e.g:
in the near future, arrays and strings will be complemented by methods
Less and less in common with MQL4...