[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 365

 
Dimka-novitsek:
Is it possible to speed up the testing process?

yes - by pressing the Stop button
 
So, I started testing 3 EAs, the computer became terribly laggy, the Opera did not respond for 5 minutes - is this normal? He has theoretically huge resources? I have two cores, memory, everything - like these tasks and 40 at once should pull? And if I turn off the Internet, but it also handles it? It has already downloaded the so-called history?
 

where's the mistake a, in terms of brackets everything seems to be straight?

//+------------------------------------------------------------------+
//|                                                        Beta2.mq4 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
extern int       StopLoss=100;
extern int       TakeProfit=20;
extern double    Lot=0.01;
extern int       cnt, ticket, total;

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
{
      double LoCurent=iCustom(NULL, 0, "LO",0,0);
      double LoPrevious=iCustom(NULL, 0, "LO",1,1);
      double FtCurent=iCustom(NULL, 0, "FT",0,0);
      double FtPrevious=iCustom(NULL, 0, "FT",1,1);
//----
   if (total=0)
      {
         if (LoCurent>LoPrevious && FtCurent>FtPrevious)
            {
               ticket=OrderSend(Symbol(),OP_BUY,Lot,Ask,3,Bid-StopLoss*Point,Bid+TakeProfit*Point,"Buy",1111,0,Green);
               if(ticket>0)
                  {
                     if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
                  }else Print("Error opening BUY order : ",GetLastError()); 
            return(0); 
            }else 
            if(LoCurent<LoPrevious && FtCurent<FtPrevious)
               {
                  ticket=OrderSend(Symbol(),OP_SELL,Lot,Bid,3,Ask+StopLoss*Point,Ask-TakeProfit*Point,"Sell",2222,0,Red);
                  if(ticket>0)
                     {
                        if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
                     }else Print("Error opening SELL order : ",GetLastError()); 
                  return(0); 
               }    
             return(0);
      }
      else 
      if(LoCurent<LoPrevious || FtCurent<FtPrevious || LoCurent<-30 || LoPrevious<-30)
         {
            if(OrderSelect(ticket,SELECT_BY_POS,MODE_TRADES)==false) break;
               {
                  if(OrderSymbol()==Symbol)
                   {
                      if(OrderType()==OP_SELL)
                         {
                         OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); // close position
                         }
                     return(0);
                   }
               }
         }
         else
            if (LoCurent>LoPrevious || FtCurent>FtPrevious || LoCurent>30 || LoPrevious>30)
               {
                  if(OrderSelect(ticket,SELECT_BY_POS,MODE_TRADES)==false) break;
                     {
                        if(OrderSymbol()==Symbol)
                           {
                              if(OrderType()==OP_SELL)
                                 {
                                    OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); // close position
                                 }
                               return(0);
                           }
                     }
               }
      }
return(0);
      }
//+------------------------------------------------------------------+
 
Yes, I'm confused by all these if-els...
 
frxmax:

where is the error a, in terms of brackets everything seems to be straight?


1) here

if (total==0)

2) brackets - structure normally - bracket under the bracket - and you will immediately see

 
Dimka-novitsek:
Yes, I'm confused by all these if-els...
What can you do? So far, the bare minimum...
 
Dimka-novitsek:
Yes, I'm confused by all these if-els...
What can you do? So far, the bare minimum...
 
abolk:


1) here

2) brackets - structure normally - bracket under the bracket - and you will immediately see

where is my total == ?

how do you mean - can you show me please?

 
frxmax:

where is my total == ?

yours.

if (total=0)

and you have to (comparison)

if (total==0)

frxmax:

how do you mean - can you show me please?


take the code of any OEM indicator and see how the code is formatted

 
abolk:

you have

and I have to...

OK, fixed it, thanks.

digging into brackets.

Even if you put everything in one line, it still gives out "unbalanced parentheses".