Helou,
I would like to ask for help, the compiler is screaming at me : "return value of 'OrderSend' should be checked"
Could you pleas write a simple line to check it?? Should I check all the variables in result?? or is Print() function sufficient??
I have no idea how to check it.........
Helou,
I would like to ask for help, the compiler is screaming at me : "return value of 'OrderSend' should be checked"
Could you pleas write a simple line to check it?? Should I check all the variables in result?? or is Print() function sufficient??
I have no idea how to check it.........
bool enviaOrden(MqlTradeRequest &solicitud, MqlTradeResult &resultado, MqlTradeCheckResult &comprueba, int desliza= 3, bool informa= true, bool modoAsincr= false) { bool exito= false; string simb= solicitud.symbol; int nDig= digitosSimb(simb), reintento= 5; ResetLastError(); exito= OrderCheck(solicitud, comprueba); if(exito) { exito= false; while(!exito && reintento>0) { if (!modoAsincr) exito= OrderSend(solicitud, resultado); else exito= OrderSendAsync(solicitud, resultado); reintento--; solicitud.deviation= solicitud.deviation+desliza; if(exito && resultado.retcode==TRADE_RETCODE_DONE_PARTIAL) { reintento= 5; exito= false; solicitud.volume= solicitud.volume-resultado.volume; solicitud.deviation= 3; } } Sleep(500); if(resultado.retcode!=TRADE_RETCODE_DONE) infoRetCode(resultado.retcode, __FUNCTION__+": "+resultado.comment, informa); } else { infoRetCode(comprueba.retcode, __FUNCTION__+": "+": "+comprueba.comment, informa); infoError(_LastError, __FUNCTION__, informa); } return(exito); }
Hi Jose, good code, however checking all else { } states, if you are using OrderSendAsync(), don't you have to test TRADE_RETCODE_PLACED return too?
Anyway, this is a good case to explain what I mean as test all if { } else { } conditions in general or for any function, like OrderSend and/or OrderSendAsync for instance.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Helou,
I would like to ask for help, the compiler is screaming at me : "return value of 'OrderSend' should be checked"
Could you pleas write a simple line to check it?? Should I check all the variables in result?? or is Print() function sufficient??
I have no idea how to check it.........