[CMD] Strooth’s Position Controller

2 656 Views No Comments 3 years ago
  • 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

    • This topic was modified 2 years, 11 months ago by Strooth.
    HaasScript Code
    Sign in or Register to download for free
Login or Register to Comment

Unlock your crypto trading potential

Create a free account and enjoy everything we have to offer.

Join for Free