I’m using the following partial close with a EUR/USD mini strategy:
ONCE partialclose = 1
IF partialclose THEN
ONCE PerCent = 0.9 //% positions to close
ONCE PerCent2 = 0.01 //% positions to close
ONCE MinLotSize = 1 //1 lots minimum
ExitQuantity = abs(CountOfPosition) * PerCent
LeftQty = max(MinLotSize,abs(CountOfPosition) - ExitQuantity)
CloseQuantity = abs(CountOfPosition) - LeftQty
ExitQuantity2 = abs(CountOfPosition) * PerCent2
LeftQty2 = max(MinLotSize,abs(CountOfPosition) - ExitQuantity2)
CloseQuantity2 = abs(CountOfPosition) - LeftQty2
IF Not OnMarket THEN
Flag = 1
Flag2 = 1
ENDIF
IF LongOnMarket and close >= (PositionPrice + 4*pipsize) AND Flag THEN
SELL CloseQuantity Contracts AT Market
Flag = 0
endif
IF ShortOnMarket and close <= (PositionPrice - 8*pipsize) AND Flag2 THEN
exitshort CloseQuantity2 Contracts AT Market
Flag2 = 0
endif
endif
This seems to work and the result is better than without partial close, but I’m getting confused between % and pips, especially as the optimization is so different for long and short (0.9 vs 0.01) ???
The profit target is 0.9% long and 0.5% short. If 0.9% is ~110 pips, how does 4*pipsize relate to that?
I tried using
IF LongOnMarket and close >= (PositionPrice * (1 + PerCentGain))
but it definitely works better with pipsize.
To put some detail on this, I find it hard to make sense of the partial closes in the attached order list.
On 19 Apr it buys 10 @ 1.19606 and sells 90% after a gain of .00067
On 29 Mar it buys 10 @ 1.17864 and sells 90% after a gain of .00109, which is a huge difference.
Is this just a matter of slippage? in which case, what should the partial close amount be, in pips?
Most grateful for any enlightenment…