Download MetaTrader 5

MQL5 to MQL4 porting

To add comments, please log in or register
Have you developed a profitable strategy? Share it with millions of traders via Signals!
Ingvar Engelbrecht
4504
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
30743
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
4504
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