Discussion of article "The Use of ORDER_MAGIC for Trading with Different Expert Advisors on a Single Instrument" - page 4

[Deleted]  
Dmitry Fedoseev:
HistorySelectByPosition() wrong?
Wrong. If 5 trades came in plus and then 3 in minus, then HistorySelectByPositionEx() would show the remaining 2 trades that make up the position. This is an analogue of open orders in MT4.
 

just in case, if anyone thinks of using this library (class), look here: https://www.mql5.com/ru/forum/171241.

I wanted to use it, but ran into problems

it is clear that it can always be tweaked, but nevertheless

 

Good afternoon!

Today I caught an interesting glitch. I switched the Expert Advisor to a virtual position and found a double entry into the position on the history during testing. The algorithm of virtual position works normally, but in this place the script managed to enter twice within one second, judging by the logs just after opening the first position has not yet come the history of opening a deal!? Everything works on the usual algorithm, I just chose the current position on the instrument and worked with it. It turns out like this - new Tick - load history toTimeCurrent - select a deal on magik - no deals - open a position - new Tick - select a deal on magik - no deals (although we know that the deal has passed) - open a position - new Tick - load history toTimeCurrent - select a deal on magik - and there is a deal with double volume. I don't see this on other trades, what do you think could be the reason for this glitch?