MQL5 to MQL4 porting

 

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
 
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__.

 
angevoyageur:

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

  Thanks angevoyageur

Thought so, just wanted to doublecheck