I need a logic prompt. Quick question.

 
for(pos=OrdersTotal()-1; pos >= 0; pos--) if ( 
    OrderSelect(pos, SELECT_BY_POS) 
    &&  OrderMagicNumber() == 1 
    &&  OrderSymbol()      == Symbol() 
    &&  OrderType()        == OP_BUY) count++; ABUY=2;                //ABUY
    
    if (count==0){
    for(pos=OrdersTotal()-1; pos >= 0; pos--) if ( 
    OrderSelect(pos, SELECT_BY_POS) 
    &&  OrderMagicNumber() == 1 
    &&  OrderSymbol()      == Symbol()  
    &&  OrderType()        == OP_BUYSTOP) count++; ABUY=1;            //ABUYSTOP
                }
    if (count==0){
    for(pos=OrdersTotal()-1; pos >= 0; pos--) if ( 
    OrderSelect(pos, SELECT_BY_POS) 
    &&  OrderMagicNumber() == 2 
    &&  OrderSymbol()      == Symbol()  
    &&  OrderType()        == OP_SELL) count++; ASELL=2;              //ASELL
                }
if (!count) {
    if (!OrderSend( Symbol(), OP_BUYSTOP, 0.1, Ask+6*point, 4,Bid-52*point, Bid+20*point, "A BUY", 1, expiration, Blue)){
        Alert("Unable to send A BUY", GetLastError()); 
       }

This code checking if there is the order I'm asking about, if it is than some variable change, and if there is not any orders than it should send the order.

The problem is that if program checks that first order exists than it change variable count>0. So the next order couldn't be checked.

So I'm thinking about:

for(pos=OrdersTotal()-1; pos >= 0; pos--) if ( 
    OrderSelect(pos, SELECT_BY_POS) 
    &&  OrderMagicNumber() == 1 
    &&  OrderSymbol()      == Symbol() 
    &&  OrderType()        == OP_BUY) count++; ABUY=2;                //ABUY
    
    if (count>=0){

If (count>=0) {

Should be it correct?

 

If (count>=0) {

What is the starting value of count? If count is set to 0 then the above condition is always true.