what is the function for (buy/sell) same pair multiple time - page 2

 
Abdul Salam: what should i add in them such that it can buy/sell the pair more than one times
  1. How many times do you need to be told/shown, that you can't. You must loop and call multiple times.
  2. Don't do that. Open one large one and do multiple closes.
 
Matthew Colter:

Your previous code that starts with 

for (int i=OrdersTotal()-1;i>-1;i--){

That just loops through the orders you have open already.

The OrderSend function sends one order. If you want to send more than one order you will have to call it more than once. You can use a for loop to do that as well if you would like.

int howMany=10;

for(;howMany>0;howMany--)
{
    // put whatever you want to happen 10 times in here.
}

for(int res=OrderSend(_Symbol,cmd,lot,pr,slip,SL,TP,comment,BN-1);res>-1;res--)

i use this syntax it go to infinity means did not stop just a repeater. what logical error in this code 

 
Abdul Salam:

for(int res=OrderSend(_Symbol,cmd,lot,pr,slip,SL,TP,comment,BN-1);res>-1;res--)

i use this syntax it go to infinity means did not stop just a repeater. what logical error in this code 

int i=0,res=0; while(i<10) {  res=OrderSend(_Symbol,cmd,lot,pr,slip,SL,TP,comment,BN-1); i++; }
Reason: