OrderMagicNumber to select an specific buy algorithm

 
Hi,
How i must understand this sentence that selects an order when it makes reference to the Magicnumber.
This is the script (what it does?)

// Order Management
//
for(cnt=OrdersTotal();cnt>=0;cnt--)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if( OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber )
{

if(OrderType()==OP_BUY)
{{
CurrentProfit=Bid-OrderOpenPrice() ;

// Did we make a profit or loss
if(ProfitMade>0 && (CurrentProfit/Point) >= ProfitMade )
{
CloseBuy("PROFIT");}

And the ordersend order is like this one:
void OpenBuy()
{
ticket=OrderSend(Symbol(),OP_BUY,lotsi,Ask,Slippage,SL,TP,TradeComment,MagicNumber,White);
gle=GetLastError();
}

The problem is that if I want to identify an order fixing magicnumberm for example, replacing it MagicNumber by 1, soon the sentence of "OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if( OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber )"
does not work

Thank you.
 
 
Thanks again Rosh.

Bye