EA closes itself


Hi everyone

I have written an EA. Everything seems spelled correctly. EA normally opens and closes positions. However, after some time, he closes positions and there is a message like this:
Position close by symbol magic, close posytion ticet#0

After this message, EA disappears from the chart closing all positions with a loss

Does anyone have any idea why this is happening?

Forum_MQL5.jpg  480 kb
Without showing your code, we can only speculate.