@realjoker said in My EA does not close losing positions sometimes???:
@piotras10000 The reason is very simple, the ea uses groups to recognize its operations, so you did not use this, what you did is place your trailing and tell it there that all open orders manually or EA modify them, so to be able to manage each 1 of them you must give 1 number (Really any variable would work (even string) to be able to later manipulate each purchase or sale as you decide, if you look I put group 1 purchase group 2 sale, so then in the closing block I use groups 1 ,2 of buy, sell close them when their condition passes. And leave the trailing as you had it so you can compare and see your mistake.0_1649292883714_Screenshot_20220407-025009_Microsoft Remote Desktop.jpg
I would suggest handling all trades as long and short instead of group numbers. As long as you have Group Mode All selected, you don't have to worry about a group # unless you do enter one in any of the original blocks. But once you do, be prepared to handle that group number separate from everything else. Its been a while, but I showed proof once to some colleagues that even those with a group # were not being handled by the "All" group mode.
I mean everything....if positions, close position, trail...each will need a separate group tree.
If you just keep it simple with longs and shorts, its much easier to handle because the Buy or Sell only selection works without hesitation.
To that affect though, for the original poster, just put everything to All and it will work fine with the trails and closed trades.