Join us live for TradersPost Tutor Sessions today at 1pm EST. Join us to learn, ask questions, and level up your automation game. Watch on YouTube
Webhook Message

Invalid Risk Dollar Amount Action

The provided quantityType action is invalid. The risk_dollar_amount quantityType can only be used when the action field is set to buy, sell, or add.

This message indicates that an invalid action was provided for the risk_dollar_amount quantity type in the request. TradersPost requires that the risk_dollar_amount quantity type can only be used with the following actions: buy, sell, or add. Any other action used in conjunction with risk_dollar_amount will be considered invalid, and the request will not be processed.

Here is an example of a valid request using the risk_dollar_amount quantity type. In this example it will buy 10 shares because we've said that the most we want to be able to lose is $100. If we get filled at $180 and we have a stop loss at $170, then if we get stopped out we'll lose $10 per share, which means we can afford to buy 10 shares.

{
    "ticker": "AAPL",
    "action": "buy",
    "orderType": "limit",
    "limitPrice": 180,
    "quantityType": "risk_dollar_amount",
    "quantity": 100,
    "stopLoss": {
        "type": "stop",
        "stopPrice": "170"
    }
}

Start trading at scale today. Sign up for free.

Free 7-day trial

Set-up in 3 minutes

Paper account for testing

Start now