I am running an automated trading strategy on TradingView that sends alerts to Tickerly, which then executes orders through the Alpaca API. Market orders execute successfully through the same pipeline:
TradingViewStrategy - Tickerly Webhook - Alpaca
However, limit orders consistently fail with the following error:
“To place a limit order for(symbol) on Alpaca, you need to specify a limit price.” This occurs across multiple symbols including equities and crypto
TradingView strategy generates the following JSON payload:
{
“ticker”: “AAVEUSD”,
“action”: “buy”,
“prev_position”: “flat”,
“quantity”: 10,
“type”: “limit”,
“price”: 85.42,
“pointer”: “v2……….Masked)” ( I removed the pointer for sharing purposes)
}
The limit price is calculated in Pine Script and formatted according to Alpaca price rules
; Price greater than and equal to 1 - 2 decimals and Price less than 1 - 4 decimals
My question is what am I missing here? what is the correct JSON structure required by Alpaca when submitting limit orders through a third-party webhook service like Tickerly?
For Alpaca limit orders, time_in_force must be gtc or ioc. Does Tickerly require me to include time_in_force in the alert payload(and if so, what key name does it expect: tif, time_in_force, etc.)? Also, should the limit value be provided as price or Limit_price for Alpaca routing?