Strategy Field

Subtract exit quantity from signal quantity

This feature is useful when you are both exiting a position and entering a new position on the other side in one signal. It can only be used when Sides is set to Both. It allows you to send a quantity that will both exit your open position and enter a new position. For example, if you have an open bullish long position on AAPL with a quantity of 10 and you want to go short 5 shares, with this feature checked, you can do the following:

{
    "ticker": "AAPL",
    "action": "buy",
    "quantity": 15
}

This will use the quantity of the open position to calculate an exit order with a quantity of 10, then it will subtract that quantity from the signal quantity of 15 and use the remaining quantity of 5 to enter a new position. If you do not have an open position, then a quantity of 15 will be entered. If you have an open position with a quantity of 5, then the exit order will be for 5 and the new position will be for 10.

Ready to automate your trading? Sign up for free today.