Topic: MQL5 errore in the code

Hello,

I am getting problems when try to instal MT5 EAs, it looks like EA Studio includes some wromg Lines in the code and the MQL5 does not compile the Experts.

Any experiences?
BR
Vincenzo

Re: MQL5 errore in the code

Which lines?

I have been using Mt5 ea's for a long time without noticing this error.

Re: MQL5 errore in the code

Me too, but time to time it write some line that doesn’t allow the mt5 to compile it.
Look at these 2, same EA MT4 get attaced and MT5 not (will send them via PM)
Would be great to get a feedback.

Re: MQL5 errore in the code

'BOT EA Farming AUDCAD H1 2122925492.mq5'            0
'MQL5_TRADE_ALLOWED' is deprecated, use 'MQL_TRADE_ALLOWED' instead    BOT EA Farming AUDCAD H1 2122925492.mq5    709    34
'lineWidth' - parameter conversion not allowed    BOT EA Farming AUDCAD H1 2122925492.mq5    1078    30
   built-in: bool TextGetSize(const string,uint&,uint&)    BOT EA Farming AUDCAD H1 2122925492.mq5    1078    30
possible use of uninitialized variable 'lineHeight'    BOT EA Farming AUDCAD H1 2122925492.mq5    1082    36
possible use of uninitialized variable 'lineWidth'    BOT EA Farming AUDCAD H1 2122925492.mq5    1081    56
possible use of uninitialized variable 'lineHeight'    BOT EA Farming AUDCAD H1 2122925492.mq5    1093    52
'lnWidth' - parameter conversion not allowed    BOT EA Farming AUDCAD H1 2122925492.mq5    1097    29
   built-in: bool TextGetSize(const string,uint&,uint&)    BOT EA Farming AUDCAD H1 2122925492.mq5    1097    29
possible use of uninitialized variable 'lineWidth'    BOT EA Farming AUDCAD H1 2122925492.mq5    1098    20
possible use of uninitialized variable 'lnWidth'    BOT EA Farming AUDCAD H1 2122925492.mq5    1098    10
possible use of uninitialized variable 'lineWidth'    BOT EA Farming AUDCAD H1 2122925492.mq5    1102    37
possible use of uninitialized variable 'lineHeight'    BOT EA Farming AUDCAD H1 2122925492.mq5    1104    34
2 errors, 8 warnings        2    8

int lineWidth, lineHeight;
   TextGetSize(robotTagline, lineWidth, lineHeight);

   if(maxRectangles == 0)
      RectLabelCreate(0, "Stats_background", 0, 0, 30, lineWidth,
                      linesCount * lineHeight, GetChartBackColor(0));

Re: MQL5 errore in the code

HI
I've just run into I think the same issue. This has happened straight after this weekends MT5 update.
Version 5 build 5100 release date 6 June 2025
Now can't compile Expert Studio portfolios.
I'll attatch an example.

errors seen follow:-
'Portfolio Expert EURUSD H4 (3).mq5'            0
'MQL5_TRADE_ALLOWED' is deprecated, use 'MQL_TRADE_ALLOWED' instead    Portfolio Expert EURUSD H4 (3).mq5    768    34
'lineWidth' - parameter conversion not allowed    Portfolio Expert EURUSD H4 (3).mq5    1128    30
   built-in: bool TextGetSize(const string,uint&,uint&)    Portfolio Expert EURUSD H4 (3).mq5    1128    30
possible use of uninitialized variable 'lineHeight'    Portfolio Expert EURUSD H4 (3).mq5    1132    36
possible use of uninitialized variable 'lineWidth'    Portfolio Expert EURUSD H4 (3).mq5    1131    56
possible use of uninitialized variable 'lineHeight'    Portfolio Expert EURUSD H4 (3).mq5    1143    52
'lnWidth' - parameter conversion not allowed    Portfolio Expert EURUSD H4 (3).mq5    1147    29
   built-in: bool TextGetSize(const string,uint&,uint&)    Portfolio Expert EURUSD H4 (3).mq5    1147    29
possible use of uninitialized variable 'lineWidth'    Portfolio Expert EURUSD H4 (3).mq5    1148    20
possible use of uninitialized variable 'lnWidth'    Portfolio Expert EURUSD H4 (3).mq5    1148    10
possible use of uninitialized variable 'lineWidth'    Portfolio Expert EURUSD H4 (3).mq5    1152    37
possible use of uninitialized variable 'lineHeight'    Portfolio Expert EURUSD H4 (3).mq5    1154    34
2 errors, 8 warnings        2    8

Hope someone can davise please.

Re: MQL5 errore in the code

Hello Traders!

Thank you for the reports!


This issue appeared in recent days. It resulted from changes in the MQL code in the latest MetaTrader update.

They changed the type of some variables without giving a deprecation warning. (Or, it was!)

I updated the MQL code of all applications to match the latest MetaTrader release.

Please reload your application and re-export the Expert Advisor.

Please report any errors or warnings you may see in the MT compiler.

Trade Safe!