
-
This is a command to easily control positions in unmanaged trading scripts and increment slots if needed.
Simply load the command at the head of your script using the CheckPos key and load your position Id’s, the name used will then be suffixed for each position opened/closed
-- Position Controller check at head/top of script local cmd = CC_PositionControl().CheckPos local shortPosId = Load('shortPosId', cmd("Trade Short", true, false)) local longPosId = Load('longPosId', cmd("Trade Long", true, true))
In the main go() function of your script before your strategy
longPosId = cmd(longPosId) shortPosId = cmd(shortPosId)
That’s all there is to it, example showing it working in the screenshots