Jump to content

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

Recommended Posts

Posted

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!!

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now


⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

×
×
  • Create New...