MQL5 code: Open parenthesis expected

 

Hi, can someone give a review to my code? It's so long to post in the topic but's just the problem of open parenthesis expected x4.

Would be very helpful to me, thanks in advance.
 
David Diez:

Hi, can someone give a review to my code? It's so long to post in the topic but's just the problem of open parenthesis expected x4.

Would be very helpful to me, thanks in advance.

Try post the section where the error occur....

 
Kenneth Parling:

Try post the section where the error occur....

if((UseBreakeven==1&&Price>BE+(PartialClose1*10)*Point)||
(UseBreakeven==2&&TP==0&&Price>BE+(PartialClose1*10)*Point)||
(UseBreakeven==2&&TP>BE&&Price>BE+(TP-BE)*(PartialClose1/100))){
   if(!trade.PositionModify(PositionGetTicket(i),BE,TP)){
      Print("OrderModify error ",GetLastError());
      return;
      }
   else{Alert("Breakeven set for ",OrderGetString(ORDER_SYMBOL)," long deal.");}                    
   }

I can't see any parenthesis error in this piece of code, but check it out anyway if you can.

 
David Diez:

I can't see any parenthesis error in this piece of code, but check it out anyway if you can.

this piece seems alright. Check error log after compiling and it should point you directly to the line(s) involved ;)

 
Kenneth Parling:

this piece seems alright. Check error log after compiling and it should point you directly to the line(s) involved ;)

i sent you a pm ;)

 
if((UseBreakeven==1&&Price>BE+(PartialClose1*10)*Point())||
(UseBreakeven==2&&TP==0&&Price>BE+(PartialClose1*10)*Point())||
(UseBreakeven==2&&TP>BE&&Price>BE+(TP-BE)*(PartialClose1/100))){
   if(!trade.PositionModify(PositionGetTicket(i),BE,TP)){
      Print("OrderModify error ",GetLastError());
      return;
      }
   else{Alert("Breakeven set for ",OrderGetString(ORDER_SYMBOL)," long deal.");}                    
   }

I'm used to MT4 but the problem was solved using () which i think is the right way here

 
Perhaps you should read the manual. Either option:
Point() returns the value of the _Point variable
          Checkup / Point - Reference on algorithmic/automated trading language for MetaTrader 5
 
William Roeder:
Perhaps you should read the manual. Either option:
Ok William, it was that.
 
Kenneth Parling:

I'm used to MT4 but the problem was solved using () which i think is the right way here

Thank you Kenneth for your priceless help, it was that.
 

Hi again, can tell me something about this? Implicit conversion from number to string...

double Ask=SymbolInfoDouble(POSITION_SYMBOL,SYMBOL_ASK);
double Bid=SymbolInfoDouble(POSITION_SYMBOL,SYMBOL_BID);
What I need is to get POSITION_SYMBOL from the loop not current symbol from the chart.
 
string position_symbol = PositionGetString(POSITION_SYMBOL);
double Ask = SymbolInfoDouble(position_symbol,SYMBOL_ASK);
double Bid = SymbolInfoDouble(position_symbol,SYMBOL_BID);