Any Suggestion:Why the button cannot function during Runtime

Various questions related to programming, testing, deployment and support.

Moderator: admin

Any Suggestion:Why the button cannot function during Runtime

Postby nhelasque » Thu Nov 23, 2023 12:14 am

class CloseAll_Action : public iActions
{
ENUM_ORDER_TYPE _type;
string _symbol;
int _magic;
int _slippage;
double _price;

bool doAction()
{
bool result=false;
int n = 0;

for (int i = OrdersTotal() - 1; i >= 0; i--)
{
if (OrderSelect(i, SELECT_BY_POS) && OrderSymbol() == _symbol && OrderMagicNumber() == _magic && OrderType() == _type)
{
if (!OrderClose(OrderTicket(), OrderLots(), _price, _slippage, clrNONE))
{
Print(__FUNCTION__, " ", "can't close Order: ", OrderTicket(), " error: ", GetLastError());
return false;
}
}
}

return result;
}
};
CloseAll_Action btnClose_Action();
nhelasque
 
Posts: 5
Joined: Tue Nov 21, 2023 10:56 pm



Return to Development

Who is online

Users browsing this forum: No registered users and 11 guests

cron