what is a full structure of an EA?

 

Dear all,

Please tell me what a full structure of an EA should be.

I've read the"Documentation" and "Book" section of MQL4 community, and complete reading the examples of EA provided by the latter section.

However, when I ran the tradingexpert.ex4 in terminal for testing, it only gave me error messages and was not work!

I guess it is because the author wants it to be an example only so he hides something behind, right?

Also, when I take a look on the EAs inside the CodeBase section, none of them are the same in structure, I am really confused.

Can anybody help me?

wing

 

Anyone can build, what they want, as if you want you can decide to wear the shirt and jacket and you can decide only after that wear socks and shoes, other people think, to wear first the socks and then wear a shirt and then later jacket and shoes
is there a problem?
eventually, all are the same dressed, what you can't do, you can't wear shoes first, then socks

 
qjol:

Anyone can build, what they want, as if you want you can decide to wear the shirt and jacket and you can decide only after that wear socks and shoes, other people think, to wear first the socks and then wear a shirt and then later jacket and shoes
is there a problem?
eventually, all are the same dressed, what you can't do, you can't wear shoes first, then socks


qjol,

thanks for reply again.

well, maybe I didn't explain my worry clear.

what I meant last time is, I though the EA "tradingexpert.mq4" provided in Book section of this community is a formal structure of writing a EA, which has the following parts:

1. variable declaration

2. preliminary processing

3. orders accounting

4. trading criteria

5. closing orders

6. order value

7. opening orders

8. function of processing errors, and

9. checking stop levels

However, when I tried to run it in tester, it couldnt run normally. After that, I took a look on some EAs provided in the Code Base section, they all have different structure. Therefore, I am confused that how I should start to plan my first EA, will I miss something important when I try to write it? that's why I would ask for your help. maybe my question seems a little bit stupid, I'm sorry for that, it's because I am a newbie.

wing

Reason: