Back to Signal Fields
Signal Fields

Quantity

The Quantity is the size of the order for this signal. Leave it empty to use the size the strategy subscription works out (its sizing settings), which is 1 when nothing else is set. The dropdown beside it, the quantity type, says what the number means. Leave it on Strategy default to use the strategy's sizing type, or choose:

  • Fixed quantity (fixed_quantity): the number of shares, contracts or units. It is the default when you send a quantity with no type.
  • Dollar amount (dollar_amount): a quantity worked out for that dollar amount.
  • Risk dollar amount (risk_dollar_amount): a quantity worked out for that much dollar risk. It needs a stop loss.
  • Risk percent (risk_percent): a quantity worked out for that percent of equity at risk. It needs a stop loss.
  • Percent of equity (percent_of_equity): a quantity worked out for that percent of your equity.
  • Percent of position (percent_of_position): a quantity worked out for that percent of the open position.

Which of these you can choose depends on the action and the asset class:

  • Fixed quantity, Dollar amount and Percent of equity can be used with Buy, Sell, Exit, Reverse, Breakeven, Add and Resize.
  • Risk dollar amount and Risk percent can be used with Buy, Sell, Reverse and Add.
  • Percent of position can be used with Buy, Sell, Exit and Reverse, not with Resize.
  • For futures, only Fixed quantity and Percent of position are available: percent and risk based sizing, and dollar amounts, are not.

The quantity must be greater than zero. With a quantity type chosen, the quantity is required. For Resize, the quantity is the size the position should end at, not the size to trade, it is always required, and 0 is valid and flattens the position. In a signal's JSON the fields are quantity and quantityType.

Each kind has an entry of its own that opens from the label once you choose it. Examples of every kind in a signal's JSON:

Fixed quantity (10 shares or contracts):

{
    "ticker": "AAPL",
    "action": "buy",
    "quantityType": "fixed_quantity",
    "quantity": 10
}

Dollar amount (about $1,000 worth):

{
    "ticker": "AAPL",
    "action": "buy",
    "quantityType": "dollar_amount",
    "quantity": 1000
}

Risk dollar amount (lose $100 at most if the stop is hit; needs a stop loss):

{
    "ticker": "AAPL",
    "action": "buy",
    "quantityType": "risk_dollar_amount",
    "quantity": 100,
    "stopLoss": {
        "stopPrice": 90
    }
}

Risk percent (lose 0.25% of equity at most if the stop is hit; needs a stop loss):

{
    "ticker": "AAPL",
    "action": "buy",
    "quantityType": "risk_percent",
    "quantity": 0.25,
    "stopLoss": {
        "stopPrice": 90
    }
}

Percent of equity (10% of your equity):

{
    "ticker": "AAPL",
    "action": "buy",
    "quantityType": "percent_of_equity",
    "quantity": 10
}

Percent of position (sell half of the open position):

{
    "ticker": "AAPL",
    "action": "sell",
    "quantityType": "percent_of_position",
    "quantity": 50
}

Without a quantityType, a quantity is a fixed quantity:

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

Resize to a target size (the position ends at 25 shares, whatever it was):

{
    "ticker": "AAPL",
    "action": "resize",
    "quantity": 25
}

Resize to zero flattens the position:

{
    "ticker": "AAPL",
    "action": "resize",
    "quantity": 0
}

A resize can also state its target as a dollar amount or a percent of equity:

{
    "ticker": "AAPL",
    "action": "resize",
    "quantityType": "percent_of_equity",
    "quantity": 10
}

Exit part of a position:

{
    "ticker": "AAPL",
    "action": "exit",
    "quantityType": "percent_of_position",
    "quantity": 25
}

Ready to put Quantity to work?

Free 7-day trial

Set-up in 3 minutes

Paper account for testing

By continuing, you agree to the TradersPost Terms of Service and Privacy Policy. This site is protected by reCAPTCHA.