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?
@ImmortalOrigin I’m not familiar with Tickerly, but I assume the format they require is simply the JSON format Alpaca requires to place an order? If that is the case, then you will need to name the parameters like this:
Also, notice you need to include a forward slash ( /) when specifying a crypto pair. In this case, it specifies you want to buy AAVE using USD from cash in your account.
Thank you for your insight and I will update in a few days, and a solution will be posted just in case some-one now or in the future faced the same issue.
Just got an email from Tickerly Tech Team, explaining to me that “Tickerly cannot send Limit orders to Alpaca" PERIOD!” I wasted weeks trying to do this and paying subscription now to Tickerly. Any idea of other exchange that is capable of doing this. I needed this format (TradingView - ??? - Alpaca). Exchange to be capable of trading equities and cryptos using Tradingview Algo.
Correct me if I am wrong but couldn’t you just do it like:
TradingView → your webhook endpoint → Alpaca directly, cutting Tickerly out entirely for limit orders. You would probably need to setup a small server that receives the TradingView signal/alert.
The learning is a lot for me and when you have a 10 hour day job, you want as little risks to take on because any system you put together will also required testing to make sure system is robust to handle all kind of situations. This means months of testing, which added more to the issue of automating the trading. Thank you for your input.
Yes there are all kinds of things that needs to be taken into consideration, a couple of nights a go i thought i was all setup to run my algo for a night and I woke up to something like -$20 it was just opening and closing positions and i was getting slowly rinsed from fees the issue was related to lot tracking something which I thought I had fixed it’s alot of trial as a solo dev.