Can someone explain why this function does not close all open orders at once?
//-------------------------------------------------------------------+ int CloseOrders(int mn) // procedure to close all orders { int total = OrdersTotal();
for (int cnt = total-1 ; cnt >= 0 ; cnt--) { OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES); if (OrderMagicNumber() == mn && OrderSymbol()==Symbol()) { if (OrderType()==OP_BUY) { OrderClose(OrderTicket(),OrderLots(),Bid,3,Green); }
if (OrderType()==OP_SELL) { OrderClose(OrderTicket(),OrderLots(),Ask,3,Red); } if (OrderType()==OP_BUYSTOP) { OrderDelete(OrderTicket()); }
if (OrderType()==OP_SELLSTOP) { OrderDelete(OrderTicket()); } } } return(0); }
Help make the information text in this indicator multicoloured and slightly bolder. The word DOWN red bold word UP green also bold text. Also to the left of the indicator names also make it a bit bolder
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Please help.
Can someone explain why this function does not close all open orders at once?
//-------------------------------------------------------------------+
int CloseOrders(int mn) // procedure to close all orders
{
int total = OrdersTotal();
for (int cnt = total-1 ; cnt >= 0 ; cnt--)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if (OrderMagicNumber() == mn && OrderSymbol()==Symbol())
{
if (OrderType()==OP_BUY)
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Green);
}
if (OrderType()==OP_SELL)
{
OrderClose(OrderTicket(),OrderLots(),Ask,3,Red);
}
if (OrderType()==OP_BUYSTOP)
{
OrderDelete(OrderTicket());
}
if (OrderType()==OP_SELLSTOP)
{
OrderDelete(OrderTicket());
}
}
}
return(0);
}
Please help.
Can someone explain why this function does not close all open orders at once:
Try this
Please help with this question.....
How do I change the TP for an order that is already open?
Please help with this question.....
How do I change the TP for an order that is already open?
try this
Thanks, I'll give it a try.
Don't you need return at the end of the function?
Thanks, I'll give it a try.
Is return at the end of the function unnecessary?
The compiler won't accept quite basic things, help me please!
int start()
int f;f=1;
It swears like this-
'int' - semicolon expected C:\Orderly couture\expertsÃärson.mq4 (38, 4)
'f' - expression on global scope not allowed C:³³'s prints³'s printsó's borders.mq4 (38, 10)
The compiler won't accept quite elementary things, help please!
int start()
int f;f=1;
It swears like this-
Who's going to put the brackets in? Pushkin? And he's right to swear, too bad he doesn't call you names )))
The compiler won't accept quite basic things, help please!
{}{}{}{}{}{}{}{}{}{}{}{}{}{}
Kind people, please help.
Help make the information text in this indicator multicoloured and slightly bolder. The word DOWN red bold word UP green also bold text. Also to the left of the indicator names also make it a bit bolder