Download MetaTrader 5
To add comments, please log in or register
Carry on your private correspondence in your profile. It is secure!
Ingvar Engelbrecht
4439
Ingvar Engelbrecht 2014.05.05 19:38 

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
29551
Alain Verleyen 2014.05.05 19:41  
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
4439
Ingvar Engelbrecht 2014.05.05 20:10  
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