Current Buys/Sells for currency EA is operating in

Hi everyone.
I’m creating my EA. Upon first placing the EA into the symbol window, I want to know how many current buys are open for that symbol and how many current sells. Can anyone help me with this? I can’t find it anywhere.
Thankyou,
Azza76

Ok, so I figured out how to know if a specific order is a buy, sell or a pending order using the following.

{
if(OrderSelect(35, SELECT_BY_POS)==true)
{
Alert(“symbol of order #”, OrderTicket(), " is ", OrderSymbol());
}
if((OrderType()==OP_BUY)||(OrderType()==OP_SELL))
{
if(OrderType()==OP_BUY)
{
Alert("Order “,OrderTicket(), " is a buy”);
}
else
{
Alert("Order “,OrderTicket(), " is a sell”);
}
}
else
{
Alert("Order “,OrderTicket(), " is a pendiing order”);
}
return 0;
}

How can I search all current orders and using this bit of code, determine if there are more buys or sells for that current currency pair for the window the EA is in?

I figured it out…

{
for (int i=0;i<=(OrdersTotal()+1);i++)
{
if(OrderSelect(i, SELECT_BY_POS)==true)
{
if((OrderType()==OP_BUY)||(OrderType()==OP_SELL))
{
if(OrderType()==OP_BUY)
{
if (OrderSymbol()==Symbol())
{
buys = buys + 1;
}
}
else
{
if (OrderSymbol()==Symbol())
{
sells = sells + 1;
}
}
}
}
}
Alert(buys," buys and “,sells,” sells");
return 0;
}