Why don’t we make a template for an EA - just a suggestion

 

Why don’t we make a template for an EA with code for handling 4/5 digits brokers and some code to handle the ECN/STP brokers issue, so newbies like me and others can use that every time we want to create a new EA. It will save a lot time for everybody in here. RaptorUK, WHRoeder and other good people that answering the same questions over and over again.

Just to be more precise. I’m not looking for anyone to come up with any code for the logic on how the EA should work, that’s up to any individual person to do that, I’m only interesting in the basic code that is needed to get an basic EA that is coded after ‘best practice’ and hopefully can work on all brokers out there.

If you think it’s not appropriate or a bad idea to do this in here, please let me know and I will remove the post again. But if you think it’s a good idea please don’t hesitate to contribute with some code snippets so we can get an EA that is coded correctly.

 
EagleEye:

Why don’t we make a template for an EA with code for handling 4/5 digits brokers and some code to handle the ECN/STP brokers issue, so newbies like me and others can use that every time we want to create a new EA. It will save a lot time for everybody in here. RaptorUK, WHRoeder and other good people that answering the same questions over and over again.

It's already been done but most people who ask the question don't want to spend the time to read, understand and utilise the code already offered . . .

https://www.mql5.com/en/forum/133792


Sorting 4/5 digits and ECN are amongst the simpler of things to address. There is also the problem of placing order correctly in accordance with this: https://book.mql4.com/appendix/limits, the issue of Trade Context busy which should be addressed using a Mutex.

I tried to address some common questions in these 2 threads:

What are Function return values ? How do I use them ?

Loops and Closing or Deleting Orders

 
RaptorUK:

It's already been done but most people who ask the question don't want to spend the time to read, understand and utilise the code already offered . . .

https://www.mql5.com/en/forum/133792


Sorting 4/5 digits and ECN are amongst the simpler of things to address. There is also the problem of placing order correctly in accordance with this: https://book.mql4.com/appendix/limits, the issue of Trade Context busy which should be addressed using a Mutex.

I tried to address some common questions in these 2 threads:

What are Function return values ? How do I use them ?

Loops and Closing or Deleting Orders


WOW!!! over 1000 lines of code in your EA.

Thanks for posting it RaptorUK, very usefull even though i don't understand everything yet :o)

Yeah i see what you mean. You guys have already been around the subject.

 
EagleEye:


WOW!!! over 1000 lines of code in your EA.

Thanks for posting it RaptorUK, very usefull even though i don't understand everything yet :o)

Yeah i see what you mean. You guys have already been around the subject.


I haven't posted the code from my EA. WHRoeder has kindly posted some of his code though . . . credit where it is due.

My current EA runs to 4600 lines including comments and blank lines. Approx 70% of that is not method dependant and would be used on any EA I coded, it is what I consider to be essential functions.