MQL4 EA compilation errors

 
//----------------------------------------------------------------------------------------------------------------------------
//Test system 
#property strict
//----------------------------------------------------------------------------------------------------------------------------
int 
Open_High=iHighest(NULL,PERIOD_D1,MODE_HIGH,20,1),         //Assignining the value of the restuned shift to a varable to
Modify_Low=iLowest(NULL,PERIOD_D1,MODE_LOW,5,1),           //be used in iHigh and iLow to determine the prices
Open_Low=iLowest(NULL,PERIOD_D1,MODE_LOW,20,1),
Modify_High=iHighest(NULL,PERIOD_D1,MODE_HIGH,5,1);

double 
Buy_Price=iHigh(NULL,PERIOD_D1,Open_High),                  //Asssigning the price values to varables for order opening  
Buy_Modify=iLow(NULL,PERIOD_D1,Modify_Low),                 //and modification
Sell_Price=iLow(NULL,PERIOD_D1,Open_Low),
Sell_Modify=iHigh(NULL,PERIOD_D1,Modify_High);

string CurrentSymbol=Symbol()

//---------------------------------------------------------------------------------------------------------------------------
int start()
{
 {
 if (CurrentSymbol!=                                       //If symbol is not one of the following stop EA execution
 ("EURUSD",                                                 
  "GBPUSD",                                               
  "USDJPY",
  "USDCAD",
  "AUDUSD",
  "NZDUSD",
  "GBPJPY",
  "GBPAUD",
  "GBPNZD",
  "GBPCAD",
  "EURGBP",
  "EURJPY",
  "EURAUD",
  "EURNZD",
  "EURCAD",
  "CADJPY",
  "NZDJPY",
  "AUDJPY")
  )
  return;
   { 
   Alert("Do not trade symbol");                           //Inform trader about incorrect symbol and stop execution                                                
   }
   }
   
  double                                                  
  Buy_Lot,                                                  //Variable to calculate the lot size of a buy
  Sell_Lot;                                                 //Variable for the calculate size of a sell
  
  for (CurrentSymbol)                                       //Cycle operater to limit EA execution to current symbol
  (
   {
   bool OrderSelect(ticket,SELECT_BY_TICKET);               //Selecting order for further processing 
   if (OrderType()<1);                                      //If order is a market order then continue
   
   RefreshRates()
   
   if(OrderType()==OP_BUY&&OrderStopLoss()<Buy_Modify)      //If order is a buy and stop is less than the updated low
   bool OrderModify(OrderTicket(),,Buy_Modify);             //Modify stop to updated low price
  
   if(OrderType()==OP_SELL&&OrderStopLoss()>Sell_Modify)    //If order is a sell and stop is greater than updated high
   bool OrderModify(OrderTicket(),,Sell_Modify);            //Modify stop to updated high price
   return;
   }
   {
   bool OrderSelect(ticket,SELECT_BY_TICKET);               //Selecting order for further processing 
   if(OrderType()>1);                                       //If order is a pening order the continue
   
   RefreshRates()
   
   if(OrderType()==OP_BUYSTOP&&OrderOpenPrice!=Buy_Price)   //If the current price of the buy stop is not equal to updated high
   bool OrderDelete(OrderTicket());                         //Delete the pending order
   
   if(OrderType()==OP_SELLSTOP&&OrderOpenPrice!=Sell_Price) //If the current price of the sell stop is not equal to the updated low
   bool OrderDelete(OrderTicket());                         //Delete the pending order
   return;
   }
   {
   if (MarketInfo(Symbol(),MODE_ASK)>=Buy_Price)            //If current symbols ask price is greater or equal to the calculated high
   {
   RefreshRates()
   
   double Buy_Lot=AccountBalance()*2,5/100/(Buy_Modify*MarketInfo(Symbol()*MODE_TICKVALUE)); //Calculating lot size
   int OrderSend(Symbol(),OP_BUYSTOP,Buy_Lot,Bid,10,Buy_Modify,0,NULL,0,0,clrNONE);          //Place buy order
   return;
   }
   }
   (
   if (MarketInfo(Symbol(),MODE_BID)<=Sell_Price)           //If current symbols bid price is greater or equal to the calculated high
   {
   double Sell_Lot=AccountBalance()2,5/100/(Sell_Modify*MarketInfo(Symbol(),MODE_TICKVALUE)); //Calculating lot size
   int OrderSend(Symbol(),OP_SELLSTOP,Sell_Lot,Ask,10,Sell_Modify,0,NULL,0,0,clrNONE);        //Place sell order
   return;
   }
   )
  )
  return()
} 

Hi all I am new to coding in MQL4

I recently coded my first EA. After compiling several errors were returned due to syntax, that I managed to fix. However several errors still remain.

After searching the compilation errors, I am still left confused as to how they relate to the lines of code that have returned errors. 

Any help in helping me understand/fixing this will be much appreciated.

Above is the code and i have attached a file containing the errors returned. Thanks 

Files:
 

You lacks a lot of ;

For example after that

string CurrentSymbol=Symbol()


after each RefreshRates(), and after the latest "return"

Also this:

bool OrderSelect(ticket,SELECT_BY_TICKET);  

and this:

for (CurrentSymbol) 


has a totally wrong syntax.


Maybe you can start to read better your code (and command documentation for syntax) instead of asking for help.

 

There is so much wrong with your code that I wouldn't know where to start.

There are many examples in the Codebase and you should start by studying some of them carefully and make sure that you can understand what is happening.

Make sure that you study code which uses OnInit() and OnTick() instead of the outdated init and start.

 
  1. #property strict
    int 
    Open_High=iHighest(NULL,PERIOD_D1,MODE_HIGH,20,1), 
    Global and static variables work exactly the same way in MT4/MT5/C/C++.
    1. They are initialized once on program load.
    2. They don't update unless you assign to them.
    3. In C/C++ you can only initialize them with constants, and they default to zero. In MTx you should only initialize them with constants. There is no default in MT5 (or MT4 with strict which you should always use.)

      MT4/MT5 actually compiles with non-constants, but the order that they are initialized is unspecified and don't try to use any price or server related functions in OnInit (or on load,) as there may be no connection/chart yet:

      1. Terminal starts.
      2. Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
      3. OnInit is called.
      4. For indicators OnCalculate is called with any existing history.
      5. Human may have to enter password, connection to server begins.
      6. New history is received, OnCalculate called again.
      7. New tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent, account information and prices are valid.
    4. Unlike indicators, EAs are not reloaded on chart change so you must reinitialize them, if necessary.
                external static variable - Inflation - MQL4 programming forum
  2. On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
              Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4

  3.  if (CurrentSymbol!=                                       //If symbol is not one of the following stop EA execution
     ("EURUSD",                                                 
      "GBPUSD",                                               
    ⋮
    
    Bogus. if(x!="a" && x!="b"…)
  4. for (CurrentSymbol)
    Bogus. Perhaps you should read the manual. There is only one current symbol — Why do you need a loop?
 

Thanks for the help and the harsh words, I know I still have a long way to go.

I will definitely read through source code to get a better understanding, are there any other suggestions in terms of resources I can use to better understand syntax? 

Reason: