Ask: How to break up EA into parts?

 

i am planning on writing a rather complex EA, and would like to break it up into parts.

what's the best approach?

thanks for your input.

 

use #include for parts, for exampe:

#include part1.mqh

 
Roger:

use #include for parts, for exampe:

#include part1.


to do that i will have to put parts of my EA into the "include" folder, is that correct?

 
 
Roger:

Yes, but it's not necessary.

https://docs.mql4.com/basis/preprosessor/include

ah, i c.

much appreciated.

 
tonyswu:

i am planning on writing a rather complex EA, and would like to break it up into parts.

what's the best approach?

thanks for your input.

or use functions, seperate your processes into many functions, i find it easier to enable/disable them when testing and such


My (2) pennies, :)

 
c0d3:

or use functions, seperate your processes into many functions, i find it easier to enable/disable them when testing and such


My (2) pennies, :)

yeah, that's what i am doing currently.

i've found it hard to separate my EA into different files, actually.

especially the issue of including the same file more than 1 time...

 
tonyswu:

yeah, that's what i am doing currently.

i've found it hard to separate my EA into different files, actually.

especially the issue of including the same file more than 1 time...

actually, divided program into different parts can make the strategy more elastic, but i think if u always want to make the program shorter by re-use different part, it cazn easily call logical error of the program, e.g. MODE_OF_TRADES and MODE_OF_HISTORY; OrderOpenTime and OrderCloseTime

Reason: