LinkParticipant
Senior
I need code to close, for example, 0.25% of the position at 12 hours. And close another 0.25% of the position at 18 hours.
There you go:
ONCE LotSize = 4
ONCE MinSize = 1
ONCE ExitLots = max(LotSize * 0.25, MinSize)
.
.
If OnMarket then
If Time = 120000 OR Time = 180000 then
Sell ExitLots contracts at Market
Exitshort ExitLots contracts at Market
Endif
Endif
LinkParticipant
Senior
and code for 2 or 3 partial position closures?
You can add as many different times as needed:
If Time = 120000 OR Time = 140000 OR Time = 170000 then