I’m testing with partial position closing and I tested the following code. It should be impossible to close half of any position if the remainder left on the market is less than 0.2 but when I check the orders list it shows positions with a size of less than 0.2 being closed.
pst = 0.2
if onmarket and close > positionprice then
if (countofposition/2) >= pst then
sell countofposition/2 contracts at market
endif
endif
if onmarket and close > positionprice * 1.005 then
sell at market
endif
I’m testing with partial position closing
I have to ask … thought we couldn’t close partial positions??
We can in back testing but not in live auto trading. I’m just trying to prepare for when we hopefully can finally can use it!