FXWizard
Гуру форума
//+------------------------------------------------------------------+
//| Поиск открытых ордеров |
//+------------------------------------------------------------------+
bool ExistPositions( int type_ord) //================
{
int ot=0;
for(int i = 0; i < OrdersTotal(); i++)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if(OrderType() == OP_BUYSTOP)
ot = 1;
if(OrderType() == OP_SELLSTOP)
ot = 2;
if(OrderType() == OP_BUY)
ot = 4;
if(OrderType() == OP_SELL)
ot = 5;
if(type_ord == ot)
return(True);
}
}
return(false);
}
//| Поиск открытых ордеров |
//+------------------------------------------------------------------+
bool ExistPositions( int type_ord) //================
{
int ot=0;
for(int i = 0; i < OrdersTotal(); i++)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if(OrderType() == OP_BUYSTOP)
ot = 1;
if(OrderType() == OP_SELLSTOP)
ot = 2;
if(OrderType() == OP_BUY)
ot = 4;
if(OrderType() == OP_SELL)
ot = 5;
if(type_ord == ot)
return(True);
}
}
return(false);
}