johnjet Posted September 24, 2010 Report Share Posted September 24, 2010 Hello guys. I'm new in programming in MQL4 but I have some idea about C++ language :D I am currently writing my first EA but I am stuck. I was wondering if someone could share with me on the flow of an EA? This is what I had in mind. Please correct me if the order is wrong or I'm missing something. start() { // First section to identify signal based on trading system and output a string with buy/sell indicator // Second section to identify if there are any open orders, and maybe close orders if signal is showing opposite direction // Third section to place an order if there are no open orders and fulfil the signal criteria } Thanks!! Quote Link to comment Share on other sites More sharing options...
chrisbenjy Posted September 24, 2010 Report Share Posted September 24, 2010 Its best to use separate methods for each section or subsection rather than placing it all in the start method; it just helps to keep the code clean and allows you to run the method several times throughout the code. Also I would say check open trades before checking entry signals, then use an if statement to make sure that the entry signals are only checked if a trade is not open. This makes it more efficient. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.