I am trying to close an open position that has a stop loss attached. I send the ID of the position to close and I get this:

event 10 desc: Sent Close position GBP/USD Price:1.8861 identifiion:2820319 Lot:1 sender= -105
event 11 desc: Command received OK. Sender= -105
event 12 desc: Update stop GBP/USD BID identifiion: 6994379 Old significance:1.8844 Worth: 1.8844 sender= 0
event 13 desc: Close position GBP/USD Price: 1.8861 identifiion: 2820319 Lot: 2.0 sender= -105
event 14 desc: New position GBP/USD Price: 1.8884 identifiion: 2820319 Lot: 1.0 sender= 0

It closes the position and opens a new one right away. It doesnt happen all of the time, just randomly. What am I doing wrong? I need to close a position!