Errors, bugs, questions - page 1856
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
How can I see the encoding?
I know that it has changed by changing the appearance of text in a third-party editor, but how to tell which encoding I do not know.
Just created an EA in ME 1580: Win-1251 (ANSI)
Yes, with Akepad I see that encoding is Win-1251 (ANSI), but older files have UTF-16LE 1200.
So it does change the default encoding for new files?
Forum on trading, automated trading systems and trading strategies testing
Features of mql5 language, subtleties and tricks
fxsaber, 2017.04.14 11:40
Yep, crooked brokers. They'd also put negative numbers in there.
It would be nice if the developers had a limit on the range of possible values of each parameter when brokers set up the symbols.
I've noticed that when I update products from the marketplace - all settings for that product on the charts are reset to defaults.
This is not right, how can this be avoided?
ArrayMaximum() and ArrayMinimum() - the order in which the parameters are passed does not match the help:
A little know-how. Bypassing the assignment operator
Result
It's not a tip, it's a perversion.
I didn't expect that from you.
It's not a smart trick, it's a perversion.
I did not expect it from you.
Forum on trading, automated trading systems and strategy testing
Libraries: TypeToBytes
fxsaber, 2017.04.13 13:34
An example of how this feature can be useful for identifying potential errors.
Writing and running the script.
Result.
_WRONG_ASSIGN_OPERATOR(STRUCT) = true
This indicates that the assignment operator will not copy the structure into a structure of the same type.
If we add more to the structure,
the result will be the same.
It may seem that by changing this operator to
but the library says otherwise.
This is perhaps the subtlest point of this example.
Correct it by
and you get the result
_WRONG_ASSIGN_OPERATOR(STRUCT) = false
Now the copy operator is correct!
We may check correctness of assignment/copying operators of any simple structure in the same way.
1. When we write like this:
It is not operator= that should be called but the copy constructor.Although, that's more a question for the Metaquotes.
2. If the copy constructor created by the compiler is not called, we can write it ourselves.
Now operator= is not called.
3. Since the structure members are available to us, we can just write it that way:
But if you make them private, then your tiphook won't help either.
4. and most importantly: operator= is used to ensure that all assignments go through it and not bypass it.
Usually, the copy constructor is defined together with it.
Yes. I looked through the sample. I did not see much profit.
1. When we write like this:
It is not operator= that should be called but the copy constructor.Although, that's more a question for the Metaquotes.
2. If the copy constructor created by the compiler is not called, we can write it ourselves.
Now operator= is not called.
3. Since the structure members are available to us, we can just write it that way:
But if you make them private, then your tiphook won't help either.
4. and most importantly: operator= is used to ensure that all assignments go through it and not bypass it.
Usually, the copy constructor is defined together with it.
Yes. I looked through the sample. I did not see much profit.
_R is a universal thing. That's why we don't need to redefine alien structures with their own operators.
Yes, with Akepad I see that the encoding is Win-1251 (ANSI), but older files have UTF-16LE 1200.
So has the default encoding for the new files changed after all?
No, it was always Win-1251 (ANSI) and at some point UTF was added. But only for those sources that contain non-Ansi characters.