Possible BUG. Block " Position Closed "
-
Hello all,
I just put 3 blocks in the "ontrade" tab directing to close open and pending trades whenever some other trade is closed.
But what happens is totally incorrect.
When opening an order in any direction, the order is closed immediately.You can put the robot on the graph and you understand what I mean.
Can you please adjust this block?
-
-
The logic is correct. Is this the whole bot or just part of it?
-
@l-andorrà This is a closeout robot, when I close any position it doesn't matter if it is manual or by another robot in my metatrader, so this should close all orders that were opened manually or automated, but it is doing it wrong.
When I open the order, it already closes it.
This looks like a BUG to me. -
Yes, definitely it is if no more blocks are involved. Please open a thread on the bugs forum explaining your case.
-
It seems that the problem started to happen after some MT5 update, because I haven't changed this code where I found the problem now. I believe I fixed it. But the Trade detection code is a little bit complicated, so I would not be surprised if there is another bug. I hope ther is not.
Here is a little tip for being able to see what is going on in these Trade events in case there is a problem like this. There is a big class where the Trade detection happens, and I added few methods to print out information about the events. Normally this information does not appear, but this can be enabled. In the source code search for "debug" and you will find this:
public: /** * Default constructor */ OnTradeEventDetector(void) { debug = false; isRepeat = false; eventValuesQueueIndex = -1; };Change debug = false; to debug = true;. Now in MT5, in the logs, information about every trade event will be printed.
-
Again, we can blame MQ5 again.
