How to stop or limit commands in EA?

 
I have a EA. it has only a single task is buy. How to stop or limit it when OrdersTotal<=10 ?. Thanks a lots.
 

if (orderstotal () >10) {enter here all ure orders so it will be like this:


if (orderstotal () >10) {your order here}

if (orderstotal () >10) {your order here}

if (orderstotal () >10) {your order here}

etc

please note i am still a noob and ive only been programming a week or so so u might want to get a second opinion :)

 

AN

The code above is incorrect

See this link https://www.mql5.com/en/forum/125841

for an example of a typical function to manage orders

-BB-

 
if (OrdersTotal() >= 10)
{
  return(0);
}

Place this over your OrderSend line.


(i though you meant >= (more or equal) not <= (Less or equal))

//Enotrek

 
Thanks a lot guys!
Reason: