Looking for function preventing Expert Advisor from opening Mulitple Orders at Once
Results 1 to 3 of 3

Thread: Looking for function preventing Expert Advisor from opening Mulitple Orders at Once

  1. #1
    Hi,

    I am new to MQL4 programming but I've been able to create a very simple EA for an entry egy I want to automate. The entry component of this works but I am having an issue limiting the amount of orders that the EA opens simultaneously. When I tested the EA it opened bunches of orders all. I didn't need this.

    Is there a function I can use to tell the EA to limit the amount of orders it opens when the entry signal is triggered? I really don't have an issue with orders being available at at precisely the time, I just don't need more than 1 order to be opened on precisely the time bar.

    I have looked on Google and on those boards and I haven't really found what I believe I want. Can any 1 help or point me in the ideal direction? I really don't require whole code, I just need to know exactly what it is and if there is.

    Thanks.

  2. #2
    Inserted Code bool IsTrade = False; for (int i = 0; i lt; Total; i ) OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if(OrderType() lt;= OP_SELL OrderSymbol() == Symbol() OrderMagicNumber() == MagicNumber) IsTrade = True; if(!IsTrade) OrderSend(...)

  3. #3
    Wow.. .Speedy reply. Thanks a million. I truly love it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.