[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 577

 
Thank you, I'll pay more attention.
 
rigonich:

I don't know. I stopped getting error 1 after OrderModify() was checked immediately before OrderSelect(), but before it was showing up all the time too.

And what kind of check did you put?!
 
Ekburg:

That's the thing, everything is normal there! I set the printers to track during the test what values are passed to the modification function, everything is normal there, the stop is different, nothing unnecessary is thrown, everything is within the limits allowed by the server, and the opponents in the code above do not allow to pass the same values...

Try checking before modifying in this way:

      double Erunda=16.0*Point;// от 12 для пятизнаков, от 2 для четырех
//
      if(MathAbs(OrderStopLoss()-sl)<Erunda && MathAbs(OrderTakeProfit()-tp)<Erunda){нет_необходимости_модифицировать;}
      else { модифицировать;}

 
Sepulca:

Try doing the check before modifying in this way:


What are these functions, what's the point of them? I've never seen or used one before.
 
Desead:

I'm getting tired of fighting with this issue, all pending orders are not deleted normally, so I use this loop to delete them:

I have even added to the loop FOR FOR and WHILE all pending orders are still there, they are not deleted. There are a lot of pending orders to delete, about 20, maybe this is some kind of difficulty?

Here is an example of deleting orders, including pending ones (I deleted them with this one):

Not all pending orders are present in this code (in the selection filter). Another error variant: check the Magick received by pending orders when they open (in your own code).

 
Ekburg:

Thanks. I have looked in the codebase, found something, tried to replace it, changed it this way and that, read thousands of lines of pro code, and not only that, but it gives out error 1 when modifying and that's it, I don't know what to do. I have faced with various difficulties in writing and the subsequent work of the EA, but to solve them myself, otherwise I don't get good experience, I've read the help, re-read the tutorial, and solved the problems, I started to think a little differently than when I started, but this problem alone did not work, so I turned to you, professionals! Trailyn would not have written it if it was not necessary for the work of the EA:)
Let me not believe you (that you have re-read everything or "so read") - the question of error #1 is covered in the tutorial and has REALLY been discussed on the forum. The answer can be found here.
 
Ekburg:

the result is the same... what are these functions, what's the point of them? I've never seen or used them before


It's not a function, it's just a check before modification, if SL or TP values are quite different from the previous ones, we modify. There is no point in modifying TP or SL by one pip, at least not to annoy DC.
 
Sepulca:


It's not a function, it's just a check before modification, if SL or TP values are different enough from previous values, then modify. It makes no sense to modify TP or SL by one pip, if only to avoid annoying DT.

Thanks, it's a good idea, I will use it from now on.
 
TarasBY:
Let me disbelieve you (that you have re-read everything or "so read") - the issue of error #1 is covered in the textbook and has been discussed REALLY on the forum. The answer can be found here.


of course i have not read everything, but i have re-read the textbook several times to find the causes of the error, but it seems they are not in the code... I will look at your link and once again read the entire article on the subject, thanks for the help, that you have not scored:)
 

Hello forum members,

I decided to write an EA for myself. I'm reading a tutorial on mql4 because I trade MT4. And here's the interesting thing. mqh files downloaded from this tutorial open (automatically) in MetaEditor 5 (I also have Mt5 installed)! Does it mean they will not work with Mt4?