how limit the number of orders on mt4?

 
how to limit the number of orders on mt4 to be allowed ? to open maximum 5 orders for example? is there any EA or script for this? or configuration?
 
neozbr:
how to limit the number of orders on mt4 to be allowed ? to open maximum 5 orders for example? is there any EA or script for this? or configuration?
   #define MAX_ORDERS 5
   
   ...

   if(OrdersTotal()>=MAX_ORDERS)
     {
      // Don't add new orders
     }
   else
     {
      // You can add new orders
     }
 
thanks! but how I add this command to the mt4? there is any tutorial ? where can I learn how to add please?
 
Alain Verleyen:

Hi,

Can you assist how this can be added on MT4 

 

There are plenty of examples on how to count orders if you search the site, here is one example.

If that doesn't make sense, you may be better looking to the Freelance section of the site.

 
Joseph Reriani:

Hi,

Can you assist how this can be added on MT4 

Sure.
 
neozbr: but how I add this command to the mt4? there is any tutorial ? where can I learn how to add please?
You have only three choices: Search for it, learn to code it, or pay (Freelance) someone to code it.
We're not going to code it for you.
We are willing to help you when you post your attempt (using SRC) and the nature of your problem.
 
Alain Verleyen:
Sure.
Please inbox me and let me know.
 
Joseph Reriani: Please inbox me and let me know.

Alain, was being sarcastic - for the very same reasons I have already given you on the other thread!

<Other thread has been removed>

 
Joseph Reriani:
Please inbox me and let me know.

The 3 threads that you have started asking the same question and using Alain's code example have now all been deleted.

Asking the same questions will not get different answers in a new thread.

   #define MAX_ORDERS 5
   
   ...

   if(OrdersTotal()>=MAX_ORDERS)
     {
      // Don't add new orders
     }
   else
     {
      // You can add new orders
     }

Alain's example is only intended to be an outline. Where he writes

// You can add new orders

is where you slot in existing code to check conditions and place orders if conditions are met. This is obvious to anyone with a rudimentary knowledge of coding mql4.

Before you can modify code, you have to learn how to. That takes effort and time.

If you do not want to put in the effort or do not have the time, then follow Honest Knaves advice.

 
neozbr:
how to limit the number of orders on mt4 to be allowed ? to open maximum 5 orders for example? is there any EA or script for this? or configuration?

I've been a programmer since 1970 in high school.  I use the internet constantly for tips and examples and have managed to stay current with programming styles, trends and techniques.  It amazes me how arrogant the people are on the mt4 forum when responding to legitimate questions from new users.  It frustrates me when I find a thread referring to the exact same question I have and some "know-it-all" posts a link and says read the manual.  You know what?  The manual is not helpful.  Very few examples.   I would make a suggestion to the self proclaimed "Guru's of MT4" to apply a little effort and type an answer.  If you don't know, don't refer someone to the manual.  Just remain quiet and let someone who knows be helpful and answer the question.  It will result in a much better forum where people like me can find quick answers. 

My answer: 

No, there is not.  The only way to limit the number of orders in MT is to keep track of them in your EA code using variable(s) that you set.  There isn't a control setting or menu item to click in the platform to accomplish this. 

Now how hard was that?  How long would you need to read the manual to figure that out?  The answer isn't in the manual.  Just an absence of the function.  My humble suggestion: Post answers to questions.  Don't post links and call the person asking the question stupid or lazy.  You are the lazy one.

Reason: