you just forgot ";" in line 29 after "m_LMAPer"...
code9527:
you just forgot ";" in line 29 after "m_LMAPer"...
I think I should get glasses...hehe, thanks man! :D
you just forgot ";" in line 29 after "m_LMAPer"...
class CTradeo { public: MqlTradeRequest request; bool ModifyPosition(string pSymbol,double pStop,double pProfit=0); MqlTradeResult result; }; bool CTradeo::ModifyPosition(string pSymbol,double pStop,double pProfit=0.000000){ request.action=TRADE_ACTION_SLTP; request.symbol=pSymbol; request.sl=pStop; request.tp=pProfit; //orderloop int retrycount=0; int checkCode=0; do{ OrderSend(request,result); checkCode=CheckReturnCode(result.retcode); if(checkCode==CHECK_RETCODE_OK)break; else if(checkCode==CHECK_RETCODE_ERROR){ string errDesc=TradeServerReturnCodeDescription(result.retcode); Alert("Modify position:Error",result.retcode," _ ",errDesc); break; } else{ Print("Server error detected, retrying..."); Sleep(RETRY_DELAY); retrycount++; }; }while(retrycount<MAX_RETRIES); if(retrycount<MAX_RETRIES){ string errDesc=TradeServerReturnCodeDescription(result.retcode); Alert ("Max retries eceeded:Error "," _ ",errDesc); } string errDesc=TradeServerReturnCodeDescription(result.retcode); Print("Modify position: ",result.retcode," _ ",errDesc,", SL: ",request.sl,",TP:",request.tp,",Bid:",SymbolInfoDouble(pSymbol,SYMBOL_BID),",Ask:",SymbolInfoDouble(pSymbol,SYMBOL_ASK),",stop Level:",SymbolInfoInteger(pSymbol,SYMBOL_TRADE_STOPS_LEVEL)); if(checkCode==CHECK_RETCODE_OK){ Comment("position modified on",pSymbol,", SL: ",request.sl,",TP: ",request.tp); return(true); } else return(false); }
Why does it make this mistake? ')' - unexpected token and ';' - unexpected token on
Sleep(RETRY_DELAY);
retrycount++;
and
while(retrycount<MAX_RETRIES);
Files:
Untitled.png
201 kb
I did this, but I made this mistake again ')' - unexpected token and ';' - unexpected token
Please look at this photo file and you will understand
Files:
Untitled.png
201 kb
MANIGHORBANPOUR #:
I did this, but I made this mistake again ')' - unexpected token and ';' - unexpected token
Please look at this photo file and you will understand
format your code so that it can be read properly, then you will be able to see where your brackets are not correctly paired...
post code with the </> button - don't use pictures for code noone is going to read it like that
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi guys,
I tried to do a simple 2 MA crossover by editing the code from here:https://www.mql5.com/en/articles/148
but I keep getting this error:
appreciate if you could explain the problem, tried googling but couldn't find the solution...thanks in advance! :D