Hi!
I strongly suggest that you make proper indentions of your code, which will make it a lot easier to find errors in the code.
See the corrected line below
// Pierre
int start ()
{
int ABUY, ASELL, pos;
if ( ABUY == 2 )
{
if ( ASELL > 0 )
{
for (pos = OrdersTotal() - 1; pos >= 0 ; pos --)
if ( OrderSelect (pos, SELECT_BY_POS) && OrderSymbol() == Symbol() )
{ // <= This parenthesis
if (!OrderDelete(OrderTicket())) // <==== You missed a ) at the end here
Alert("OrderDelete(",OrderTicket(),") failed: ", GetLastError());
} // ...and this parenthesis can be removed since there is only one line of code
}
}
return (0);
}
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
int start ()
{
int ABUY, ASELL, pos;
if ( ABUY== 2 ) {}
return (0);
}