It seems new update of MT5 have problem with Trade Structure, I recive error when compile code. Also my old code not complied.
it is sample code of MQL5 reference but it is not complied , I use Meta trader ,version 5.00 build 2949
Forum on trading, automated trading systems and testing trading strategies
Features of the mql5 language, subtleties and methods of work
Ilyas , 05/20/20/28 18:18
We are expanding the initialization sequences "{...}", in the next build it will be allowed to use any expression, not just a constant one.
Instead of this change, there will be a restriction on the use of constants for enumerations (as for a regular expression): if the constant is not included in the enumeration, an appropriate error will be generated.
Analysis of the existing codes showed that the sequence of one zero - "{0}" is often used incorrectly
For example like this:
MqlTradeRequest request={ 0 };
Such an entry means setting the value to zero for the first field of the structure and zeroing the rest of the fields.
For the above line of code, according to the new rules, an error will be generated, since the first field is of type ENUM_TRADE_REQUEST_ACTIONS , an enumeration missing the value "0"
cannot convert 0 to enum 'ENUM_TRADE_REQUEST_ACTIONS'
Correctly it will be like this:
MqlTradeRequest request={};
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
It seems new update of MT5 have problem with Trade Structure, I recive error when compile code. Also my old code not complied.
it is sample code of MQL5 reference but it is not complied , I use Meta trader ,version 5.00 build 2949