Hi,
I'm writing a code in which I want to close my last opened order, and the expert is working fine.
The problem is, when I compile it and there have 2 warnings shown in MetaEditor.
//CloseLastBuy -------------------------------------------------------------------------------
int CloseLastBuy()
{
int i_ticket = OrdersTotal()-1;
if (i_ticket > -1
&& OrderSelect (i_ticket, SELECT_BY_POS))
{
if(OrderSymbol()==Symbol() && OrderMagicNumber()==mag1)
{
if(OrderType()==OP_BUY)
OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(MarketInfo(Symbol(),MODE_BID),
MarketInfo(Symbol(),MODE_DIGITS)),1000,Gold);
}
}
return(1);
}
Does anyone know what's the problem?
Thanks for your help.
I'm writing a code in which I want to close my last opened order, and the expert is working fine.
The problem is, when I compile it and there have 2 warnings shown in MetaEditor.
//CloseLastBuy -------------------------------------------------------------------------------
int CloseLastBuy()
{
int i_ticket = OrdersTotal()-1;
if (i_ticket > -1
&& OrderSelect (i_ticket, SELECT_BY_POS))
{
if(OrderSymbol()==Symbol() && OrderMagicNumber()==mag1)
{
if(OrderType()==OP_BUY)
OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(MarketInfo(Symbol(),MODE_BID),
MarketInfo(Symbol(),MODE_DIGITS)),1000,Gold);
}
}
return(1);
}
Attached Image
Does anyone know what's the problem?
Thanks for your help.