mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-19 13:48:11 +00:00
MQL4: update function OrderClose to avoid compile warnings
This commit is contained in:
Binary file not shown.
+11
-2
@@ -3796,15 +3796,24 @@ bool OrderCloseAll()
|
|||||||
if (OrderSelect(i, SELECT_BY_POS))
|
if (OrderSelect(i, SELECT_BY_POS))
|
||||||
{
|
{
|
||||||
int type = OrderType();
|
int type = OrderType();
|
||||||
|
bool order_closed = true;
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
//Close opened long positions
|
//Close opened long positions
|
||||||
case OP_BUY: OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red );
|
case OP_BUY:
|
||||||
|
{
|
||||||
|
order_closed = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red );
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
//Close opened short positions
|
//Close opened short positions
|
||||||
case OP_SELL: OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red );
|
case OP_SELL:
|
||||||
|
{
|
||||||
|
order_closed = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red );
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (order_closed == false)
|
||||||
|
Print("Failed to close order ", OrderTicket());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user