Detected Country () : English
Close - All Pending Orders - codingforex.com

Welcome to CodingForex.Com!

Knowledge portal where you can learn how to create forex indicators and robot.

Click button below to choose level that suite you:

Close - All Pending Orders

Scripts [2017-03-30 09:02:50] - by hillzx
Featured Image

void CloseAllPO(){

  int total = OrdersTotal();
  for(int i=total-1;i>=0;i--)
  {
    OrderSelect(i, SELECT_BY_POS);
    int type   = OrderType();

    bool result = false;
   
    switch(type)
    {
      //Close pending orders
      case OP_BUYLIMIT  :
      case OP_BUYSTOP   :
      case OP_SELLLIMIT :
      case OP_SELLSTOP  : result = OrderDelete( OrderTicket() );
    }
   
  }
 
}

 

Usage :

CloseAllPO();


Good luck, do not forget to share and follow our official facebook and youtube, happy trading!






- Provided by HiLLzSoft Studio -