unbalanced left paranthesis

 

Hi.

I have got a problem trying to use EA calles "usualexpert.mq4" taken from S. Kovalyov book available on mql4.com website. I copied all fuctions and #include files from the book, made an attempt to compile the following code (which is almost the same as "usualexpert.mq4" EA):

#include <stdlib.mqh>
#include <stderror.mqh>
#include <WinUser32.mqh>
//----------------------------------------------------------------------------------- 3 --
#include <Variables.mqh>   // Description of variables 
#include <Terminal.mqh>    // Order accounting
#include <Events.mqh>      // Event tracking function
#include <Inform.mqh>      // Data function
#include <Trade.mqh>       // Trade function
#include <Open_Ord.mqh>    // Opening one order of the preset type
#include <Close_All.mqh>   // Closing all orders of the preset type
#include <Tral_Stop.mqh>   // StopLoss modification for all orders of the preset type
#include <Lot.mqh>         // Calculation of the amount of lots
#include <Criterion.mqh>   // Trading criteria
#include <Errors.mqh>      // Error processing function
//----------------------------------------------------------------------------------- 4 --
int init()                             // Special function 'init'  
   {   
   Level_old=MarketInfo(Symbol(),MODE_STOPLEVEL );//Min. distance   
   Terminal();                         // Order accounting function    
   return;                             // Exit init()   
   }
//----------------------------------------------------------------------------------- 5 --
int start()                            // Special function 'start'  
   {  
   Terminal();                         // Order accounting function    
   Events();                           // Information about events   
   Trade(Criterion());                 // Trade function   
   Inform(0);                          // To change the color of objects   
   return;                             // Exit start()  
   }
//----------------------------------------------------------------------------------- 6 --
int deinit()                           // Special function deinit()  
   {   
   Inform(-1);                         // To delete objects   
   return;                             // Exit deinit()  
   }
//----------------------------------------------------------------------------------- 7 --
and got following message: "\'end_of_program' - unbalanced left paranthesis". I studied the code many times and haven't found any mistakes with the paranthesis. What can be wrong? Is it something with the complier??
 

T

Likely the problem is in one of the included files - i.e. somewhere in a .mqh file

Rem out all lines in your EA, like

//    Level_old=MarketInfo(Symbol(),MODE_STOPLEVEL );//Min. distance   
//    Terminal();                         // Order accounting function 

and if the error still persists, rem out the #include items one by one, like

// #include <Errors.mqh>      // Error processing function

Good Luck

-BB-

 

Thanks BB. After removing #include files one by one I discover that somethings wrong with #include <CloseAll.mqh> file (which I modified after coping from the book - probabely I made some mistake). I will focus on this part of EA and hopefully solve the problem.

 

an editor like Geany highlights the corresponding parenthesis, if the cursor is on the other.

helps a lot

choose document -> filetype -> C to highlight MQL code

 
Thanks for tip meikel.
Reason: