Download MetaTrader 5

MQL5 to MQL4 porting

To add comments, please log in or register
Ingvar Engelbrecht
4505
Ingvar Engelbrecht  

I have a couple of good reasons  to port my MT5 EA to the MT4 platform. Below is a sample of a technique I am planninmg to use in some instances to simplify maintenance of the "main" code

I just wonder if there are any specific drawbacks using this technique


#ifdef __MQL4__
bool PositionSelect(string pair)
 {
 
   //PlaceMQL4 code here
   
   return false;
 }
 
#endif
Alain Verleyen
Moderator
33773
Alain Verleyen  
ingvar_e:

I have a couple of good reasons  to port my MT5 EA to the MT4 platform. Below is a sample of a technique I am planninmg to use in some instances to simplify maintenance of the "main" code

I just wonder if there are any specific drawbacks using this technique


Seems ok. This is the goal of #ifdef and __MQL4__.

Ingvar Engelbrecht
4505
Ingvar Engelbrecht  
angevoyageur:

Seems ok. This is the goal of #ifdef and __MQL4__.

  Thanks angevoyageur

Thought so, just wanted to doublecheck

To add comments, please log in or register