insert break function

Dua Yong Rew
5737
Dua Yong Rew  

Do I need to insert the break function?

If so, where do I insert? Before return or after return?

//+------------------------------------------------------------------+
//| One Position                                                     |
//+------------------------------------------------------------------+
bool OnePosition(ENUM_ORDER_TYPE ordertype)
  {
//---

   for(int i = OrdersTotal() - 1; i >= 0; i--)
   {
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false)
      {
         Print("Error in orders!");

         break;
      }

      if(OrderSymbol() == _Symbol && OrderMagicNumber() == MagicNum)
      {
         if(OrderType() == ordertype)
         {
            return(true);
         }
      }
   }

//---
   return(false);
  }