johnjet Posted September 24, 2010 Report 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!!
chrisbenjy Posted September 24, 2010 Report 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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now