When your signal does not have a price, TradersPost will fetch a quote from the broker and use the configured market price type from the strategy settings instead of using the price from the signal. By default, the Bid-ask midpoint
will be used. For example, if you have limit
orders configured and you send a signal without a limitPrice
, then TradersPost will use the the price from the quote.
{
"ticker": "AAPL",
"action": "buy",
"orderType": "limit"
}
Or if you specify a limitPrice
, then that value will be used.
{
"ticker": "AAPL",
"action": "buy",
"orderType": "limit",
"limitPrice": 100
}
If the broker you are using does not support quotes, such as Tradovate, then you must always send a price in your signal. For example, if you are using market orders and you are attaching a takeProfit
and stopLoss
to your entry order, then you must send a signalPrice
in your signal to be used to calculate other prices based on your estimated entry price.
{
"ticker": "AAPL",
"action": "buy",
"orderType": "market",
"signalPrice": 100,
"takeProfit": {
"amount": 10
},
"stopLoss": {
"type": "stop",
"amount": 5
}
}
In the above example, a takeProfit.limitPrice
of $110
and a stopLoss.stopPrice
of $95
will be calculated based on the signalPrice
of $100
.