I think I've misunderstood how partial closing works. I was hoping to use it to reduce losses on losing positions.
Say I have a buy position open with a TP and SL set, I've bought 100 lots. The position starts to go bad and approaches my stop loss. Before it hits the stop loss, my EA uses the OrderClose command to partially close it, the lots specified in the parameters is 99 so as to set the losing position to 1 lot instead of 100. A small loss occurs at this point when orderclose successfully executes, however the price continues to go in the wrong direction, approach my SL until it is finally hit. What I was expecting is that when the SL is hit, I'd only have 1 lots exposed but instead a new buy position opens sized at 99 lots and my loss is 99 lots.
Note, I am spreadbetting not forex here. 100 lots in MT4 speak equals 100 points, at 1$ per point. So 100$ per point the price moves up or down. A S/L set at 15 points away from position open price would therefore be a loss of 15points x 100$ = 1500$, ouch!
I guess I was being somewhat optimistic to think that I could change the lots just before a SL and realize a much smaller loss ? have I misunderstood how this works? I wonder what would happen is I partially closed and removed the SL ..?
You've misunderstood just about everything.