Download MetaTrader 5
To add comments, please log in or register
MQL5 library has more than 1500 apps already. Contribute your own one!
Automated-Trading
Admin
88669
Automated-Trading 2013.07.23 08:29 

MQL4 to MQL5 compatibility library:

Short description.

Author: T-1000

Alain Verleyen
Moderator
28671
Alain Verleyen 2013.07.23 16:26  

Hello,

Unfortunately, your library is incomplete and bugged. I am trying to use your library with this mql4 indicator http://codebase.mql4.com/7472. I follow your instructions and I get 47 errors and 14 warnings.

'JJN-Fibo_with_compat_library.mq5'    JJN-Fibo_with_compat_library.mq5    1    1
'mql4compat.mqh'    mql4compat.mqh    1    1
'i' - undeclared identifier    JJN-Fibo_with_compat_library.mq5    150    8
'ObjectDelete' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    175    4
'ObjectDelete' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    176    4
'ObjectDelete' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    177    4
'ObjectDelete' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    178    4
'ObjectDelete' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    179    4
'ObjectDelete' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    180    4
'ObjectDelete' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    181    4
'DisplayDec' - undeclared identifier    JJN-Fibo_with_compat_library.mq5    190    4
'ObjectCreate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    196    4
'DisplayDec' - undeclared identifier    JJN-Fibo_with_compat_library.mq5    197    100
'StringConcatenate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    197    30
implicit conversion from 'number' to 'string'    JJN-Fibo_with_compat_library.mq5    197    30
'ObjectCreate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    198    4
'StringConcatenate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    199    30
implicit conversion from 'number' to 'string'    JJN-Fibo_with_compat_library.mq5    199    30
'ObjectCreate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    200    4
'StringConcatenate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    201    30
implicit conversion from 'number' to 'string'    JJN-Fibo_with_compat_library.mq5    201    30
'ObjectCreate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    202    4
'StringConcatenate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    203    30
implicit conversion from 'number' to 'string'    JJN-Fibo_with_compat_library.mq5    203    30
'ObjectCreate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    204    4
'StringConcatenate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    205    30
implicit conversion from 'number' to 'string'    JJN-Fibo_with_compat_library.mq5    205    30
'ObjectCreate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    206    4
'StringConcatenate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    207    30
implicit conversion from 'number' to 'string'    JJN-Fibo_with_compat_library.mq5    207    30
'ObjectCreate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    208    4
'StringConcatenate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    209    30
implicit conversion from 'number' to 'string'    JJN-Fibo_with_compat_library.mq5    209    30
'ObjectCreate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    214    4
'DisplayDec' - undeclared identifier    JJN-Fibo_with_compat_library.mq5    215    104
'StringConcatenate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    215    30
implicit conversion from 'number' to 'string'    JJN-Fibo_with_compat_library.mq5    215    30
'ObjectCreate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    216    4
'StringConcatenate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    217    30
implicit conversion from 'number' to 'string'    JJN-Fibo_with_compat_library.mq5    217    30
'ObjectCreate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    218    4
'StringConcatenate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    219    30
implicit conversion from 'number' to 'string'    JJN-Fibo_with_compat_library.mq5    219    30
'ObjectCreate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    220    4
'StringConcatenate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    221    30
implicit conversion from 'number' to 'string'    JJN-Fibo_with_compat_library.mq5    221    30
'ObjectCreate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    222    4
'StringConcatenate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    223    30
implicit conversion from 'number' to 'string'    JJN-Fibo_with_compat_library.mq5    223    30
'ObjectCreate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    224    4
'StringConcatenate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    225    30
implicit conversion from 'number' to 'string'    JJN-Fibo_with_compat_library.mq5    225    30
'ObjectCreate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    226    4
'StringConcatenate' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    227    30
implicit conversion from 'number' to 'string'    JJN-Fibo_with_compat_library.mq5    227    30
'ObjectDelete' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    99    4
'ObjectDelete' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    100    4
'ObjectDelete' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    101    4
'ObjectDelete' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    102    4
'ObjectDelete' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    103    4
'ObjectDelete' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    104    4
'ObjectDelete' - wrong parameters count    JJN-Fibo_with_compat_library.mq5    105    4
'return' - 'void' function returns a value    JJN-Fibo_with_compat_library.mq5    110    4
47 error(s), 14 warning(s)        48    15

T-1000
221
T-1000 2013.07.24 05:06  
angevoyageur:

Hello,

Unfortunately, your library is incomplete and bugged. I am trying to use your library with this mql4 indicator http://codebase.mql4.com/7472. I follow your instructions and I get 47 errors and 14 warnings.

The function names which are giving errors need to be adjusted by adding MQL4 in the end of their names so compilation erors will go away.

ALso I did test that indicator on MT4, seems it did not work properly there too.

P.S> I did some minor update and tweaks for compatibility library so you might grab latest version 1.1 as soon as it will be approved. In v1.0 the string StringConcatenate() function would not work properly as it conflicts between MQL4 and MQL5 in way how it works - added StringConcatenateMQL4 in v1.1
Alain Verleyen
Moderator
28671
Alain Verleyen 2013.07.24 10:52  
T-1000:
The function names which are giving errors need to be adjusted by adding MQL4 in the end of their names so compilation errors will go away.

ALso I did test that indicator on MT4, seems it did not work properly there too.

P.S> I did some minor update and tweaks for compatibility library so you might grab latest version 1.1 as soon as it will be approved. In v1.0 the string StringConcatenate() function would not work properly as it conflicts between MQL4 and MQL5 in way how it works - added StringConcatenateMQL4 in v1.1

Thanks for your reply. I will check when your version 1.1 will be available.

  • If a lot a function name need to be adjusted, it's no more a compatibility library, it would be better to adjust your library to suppress the 'MQL4' suffix. I know it's not possible for all function (StringConcatenate for example).
  • I suggest you to check this kind of code, as WHOLE_ARRAY is not intended to work with Copyxxxx function, and the result of this function is probably not what you wish.
void __Open(double &_Open[])
  {
   ArraySetAsSeries(_Open,true);
   CopyOpen(_Symbol,_Period,0,WHOLE_ARRAY,_Open);  // What is the returned value ?
  }
/
To add comments, please log in or register