This expert advisor is named Main, and can be downloaded here, because it is structured in a way that many different other EAs (expert advisors) can be derived from this main EA fast. It is divided into different modules, each has a different task. Allmost all EAs will include these modules. Many modules can be reused in other EAs. Only some modules need to be modified to comply the new EA's strategies/rules.
I think an EA should be divided into these modules:
1/Market Status,
2/ Account Status,
3/ Signal Generator,
4/ Draw,
5/ Strategy,
6/ Buy,
7/ Sell,
8/ CloseAll,
9/ CloseAllBuy
10/ CloseAllSell
11/ TradeModify,
I think an EA should be divided into these modules:
1/Market Status,
2/ Account Status,
3/ Signal Generator,
4/ Draw,
5/ Strategy,
6/ Buy,
7/ Sell,
8/ CloseAll,
9/ CloseAllBuy
10/ CloseAllSell
11/ TradeModify,