int OpenBuyOrders;
int OpenSellOrders;
int total;
int start()
{
OpenBuyOrders=0;
OpenSellOrders=0;
total=0;
//Count Pending Stop Orders
for(int i=0; i<OrdersTotal(); i++ )
{
if(OrderSelect(i, SELECT_BY_POS)==true)
{
if (OrderType()==OP_BUY)
OpenBuyOrders++;
if (OrderType()==OP_SELL)
OpenSellOrders++;
}
total=OpenBuyOrders + OpenSellOrders;
}
Comment ("buy_stop=",OpenBuyOrders," sell_stop=",OpenSellOrders," total=",total);
}
No comments:
Post a Comment