scipt is not working --
scipt is not working --
Try this version.
// An EA to close all pending orders
void OnTick()
{
//---
{
int Welbeck=OrdersTotal();
for(int i=0;i<Welbeck;i++)
{
ResetLastError();
//--- copy into the cache, the order by its number in the list
ulong tickett= OrderGetTicket(i);
if(tickett>0)
{
if(mytrade.OrderDelete(tickett)) //--- Request successfully completed
{
Alert("An opened order has been successfully closed!!");
}
else
{
Alert("The order close request could not be completed - error: ",
mytrade.ResultRetcodeDescription());
}
}
}
}
}
// An EA to close all pending orders
void OnTick()
{
//---
{
int Welbeck=OrdersTotal();
for(int i=0;i<Welbeck;i++)
{
ResetLastError();
//--- copy into the cache, the order by its number in the list
ulong tickett= OrderGetTicket(i);
if(tickett>0)
{
if(mytrade.OrderDelete(tickett)) //--- Request successfully completed
{
Alert("An opened order has been successfully deleted !!");
}
else
{
Alert("The order delete request could not be completed - error: ",
mytrade.ResultRetcodeDescription());
}
}
}
}
}
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
CloseAllPositions:
The script closes all open positions on the current account.
Author: Nikolay Kositsin