This message indicates that the stopLoss.percent provided in the request is invalid. TradersPost requires that the stopLoss.percent be a valid positive number. This percentage is used to calculate a stop loss stop price relative to your positions entry price.
For example, if a stop loss percent such as "-10" or "10 percent" is provided, the request will not be processed.
This error can occur due to several reasons, such as:
stopLoss.percent is a negative number.stopLoss.percent is not a number (e.g., it contains letters or special characters).stopLoss.percent is zero or improperly formatted according to the required parameters.stopLoss.percent in your request is a positive number and correctly formatted to avoid this error.Invalid stopLoss.percent example:
{
"ticker": "AAPL",
"action": "buy",
"orderType": "limit",
"limitPrice": 100,
"stopLoss": {
"type": "stop",
"percent": "5 percent",
},
}
Valid stopLoss.percent example:
{
"ticker": "AAPL",
"action": "buy",
"orderType": "limit",
"limitPrice": 100,
"stopLoss": {
"type": "stop",
"percent": "5",
},
}
In the above example, a stop loss stop price of $95 would be calculated based on the entry limit price of $100 and the stop loss percent of 5%. This would result in a stop loss order being converted to a market order if the price touches the $95 stop price.