making orderselect pair specific....

 

Can anyone help me please! I need my EA to only delete orders that are of a certain pair:

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

bool result = false;

switch(type)
{

case OP_BUYSTOP : result = OrderDelete( OrderTicket() );
break;
case OP_SELLSTOP : result = OrderDelete( OrderTicket() );
break;
}

if(result == false)
{
Sleep(1000);
}
}
}

Can someone please help me make this pair specific!? thank you so much...... Daniel

 
forexman05 wrote >>

Can anyone help me please! I need my EA to only delete orders that are of a certain pair:

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

bool result = false;

switch(type)
{

case OP_BUYSTOP : result = OrderDelete( OrderTicket() );
break;
case OP_SELLSTOP : result = OrderDelete( OrderTicket() );
break;
}

if(result == false)
{
Sleep(1000);
}
}
}

Can someone please help me make this pair specific!? thank you so much...... Daniel

if ((OrderSymbol()==symbol) && (OrderType()==OP_BUYSTOP || OrderType()==OP_SELLSTOP) )deleteorder

 

Well, it's so hard... :p

if (totalO==1)
{
for(i=OrdersTotal()-1;i>=0;i--)
{
if (OrderSelect(i, SELECT_BY_POS,MODE_TRADES)==True)

  {

    if (OrderSymbol()==my_required_pair )

      {

      }

  }

}

}