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....
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.
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
Checkup / Point - Reference on algorithmic/automated trading language for MetaTrader 5
Perhaps you should read the manual. Either option:
I'm used to MT4 but the problem was solved using () which i think is the right way here
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);
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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.