Well i can spot 2 problems, but from your post it's unclear what the problem is you want solved.
if(OrderType()==OP_BUY){ if(TS>0){ if(Bid-OrderOpenPrice()>Point*(TS*places)){ if((OrderStopLoss()< (Bid-Point*(TS*places))) || (OrderStopLoss()==0)){ bool modi=OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*(TS*places),0,0,Green); return(0);// you are returning here so not every open order will be updated -> use continue } } if (!modi){//this will never execute since you're returning Print("Error modify BUY order : ",GetLastError()); return(0); } } }hth
I tried without return in both places also, but still same error.
Error 4202 is related to Objects... It has nothing to do with OrderModify().
ERR_OBJECT_DOES_NOT_EXIST | 4202 | Object does not exist. |
Yes, but if I delete this code then there is no error. I think problem is in this code because Print (...) is there and says "Error modify..."
01005379:
You should set the value of modi to a known state at the beginning of the loop and also call GetLastError() to clear the error buffer. That error probably originates somewhere else in your code...
Yes, but if I delete this code then there is no error. I think problem is in this code because Print (...) is there and says "Error modify..."
Thanks! I found solution.
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
Hello!
Can anyone tell me where is the problem? Thanks!