multible order modify

 

Hello


My ea has the problem does the OrderModify turns multible


for (int i=0;i<OrdersTotal();i++){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderComment() == Text && Hour() == (Start1 - 1) && Minute() >= 55 ){

if( OrderType() == OP_BUY && OrderProfit() != 0 ){ //no buy order
Ticket = OrderModify(OrderTicket(),OrderOpenPrice(),TL_Long,OrderTakeProfit(),OrderExpiration(),Blue);
}


if( OrderType() == OP_SELL && OrderProfit() != 0 ){ //no sell order
Ticket = OrderModify(OrderTicket(),OrderOpenPrice(),TL_Sell,OrderTakeProfit(),OrderExpiration(),Green);
}
}
}

Sleep(300000);

return(0);


what can i do that this runs only one time?


kind regards

 
int done=0;

modify_orders();

void modify_orders()
{

if (done==1);return();

///your code here



done=1;

return();

}
Reason: