Guide
TrendSpider alerts to your broker, automatically
TrendSpider can post a webhook when an Alert fires or a Strategy Bot changes state. Point that webhook at a Nyria strategy and each post becomes an order in your own brokerage account, sized by the bot you deploy. This guide covers how the alert reaches Nyria, what the message has to say, which brokers and asset types it can trade, and the paper run to do before the live one.
How a TrendSpider alert reaches Nyria
- 1
Create the strategy and copy its webhook URL
In Nyria, create a strategy with TrendSpider as the alert source, open its Integration tab and copy the webhook URL. Each strategy has its own URL, with its own 64-character token at the end. Keep it private: anyone who has it can send alerts to the strategy, and Rotate token on the same tab replaces it at once.
- 2
Set the webhook in TrendSpider
Open Account & Settings, check Webhook, paste the URL, and set the method to POST. A plain Alert posts from this one account-level URL, so the account webhook feeds one Nyria strategy. To reach several strategies, give each Strategy Bot its own URL and body instead.
- 3
Put the payload in the note
TrendSpider posts each alert's note as the request body, sent as JSON when the note is valid JSON. Write the message there, with TrendSpider's own variables where you want them filled in.
- 4
Check the format, then activate
On the strategy's Integration tab, give one example alert per trade type and select Check format. The strategy goes Active once its alert format passes.
The token in the URL is the only authentication on the request: there is no signature header and no IP allowlist. Treat the URL like an API key.
What the message must say
Every alert needs a ticker, a direction and an action. There is no fixed template beyond that.
Alert note
{
"symbol": "%alert_symbol%",
"action": "buy",
"price": "%last_price%"
}Strategy Bot body
{
"symbol": "%bot_symbol%",
"action": "sell",
"price": "%last_price%"
}The smallest body has two fields, the ticker and the action. Nyria finds the strategy from the token in the URL and reads buy or sell against that strategy's settings: on a long-only strategy, buy opens a long and sell closes it. TrendSpider fills in its own variables with percent signs around the name, not the curly braces TradingView uses. %alert_symbol% is the symbol an Alert fired on, %bot_symbol% is a Strategy Bot's symbol, and %last_price% is the last price when it fired. There is no action or quantity variable, so write buy or sell into each alert yourself and leave quantity out. An alert cannot set the size: it always comes from the bot's settings, and Nyria ignores a quantity key on an entry alert.
A price in the alert is the limit when the strategy's limit target is Alert price. Otherwise Nyria prices from the live chain, and an entry it cannot price is not placed. To state the side outright, or to reverse in one alert, send action as OPEN or CLOSE together with direction as LONG or SHORT.
Which brokers and asset types
A TrendSpider alert trades stocks, ETFs and options up to 4 legs at Charles Schwab, Tradier, tastytrade and Alpaca; Alpaca adds crypto spot. Nyria Paper, the free simulated broker built into Nyria, trades stocks, options and crypto with no credentials. On every broker Nyria places market and limit orders only, in whole shares and whole contracts; it does not place stop or stop-limit orders, and exits come from exit alerts. Exchange futures such as ES and NQ are not tradeable on any broker today.
For options, a strategy set to Provided in alert trades the strike, expiry and type the alert sends, and refuses an entry that leaves one out; a TrendSpider alert has to name the expiration. One set to From my rules ignores them and picks the contract from its own delta, strike and expiry settings, and the webhook has no field to override those.
A worked example, from a Strategy Bot to Alpaca
A stock strategy, long only, Close on exit alerts on, market orders for entries and exits. The Strategy Bot runs on an AAPL chart.
What TrendSpider posts when the bot buys
{ "symbol": "AAPL", "action": "buy", "price": "341.20" }A bot on the strategy runs on an Alpaca paper account with a $500 budget per entry. Nyria reads AAPL as the ticker and buy as a long entry. The strategy's order type is market, so the price is recorded and not used; the bot sends Alpaca a market order for 1 share, since stocks trade in whole shares and one share near $341 is what $500 covers. When the Strategy Bot sells, the same body with sell closes the whole position; there is no partial-close field. The alert shows as a row on the strategy's Logs tab, and the order and what Alpaca did with it on the bot's Logs tab.
Nyria drops a body that repeats an earlier one: the same body again within 30 seconds is a duplicate. So is one within 5 minutes with nothing else in between. The repeat answers 200 with a status of duplicate and never trades, so a Strategy Bot that scales in with the same fixed body twice trades once. Include a value that changes, such as %last_price%, so each body differs.
Paper first, then live
Deploy the first bot on Nyria Paper: one click, no credentials, and the free plan runs up to 10 paper bots with no time limit. Let the real TrendSpider alerts fire for a week or two and read the Logs tab. Each alert has a row there, and a rejected or failed one carries its reason, so you can see that each message traded what you meant and that each exit closed its entry. Nyria Paper fills or refuses each order at once, so a limit order never rests there the way it does at a broker. A 200 from the webhook means Nyria read the alert and handed it to your bots; it does not mean a broker filled anything.
When the paper run reads right, deploy a second bot on the same strategy on the broker account, or edit the paper bot to use it. The same body works at every connectable broker: Nyria converts it into that broker's order format.
The setup reference, with TrendSpider's own variables, is the Connect TrendSpider alerts page of the docs. The variables and the by-broker pairs are on the TrendSpider alert source page, and the alert tester shows how Nyria reads a body before you send a real one.
Questions
- Can one TrendSpider webhook feed several Nyria strategies?
- A plain Alert posts from one account-level URL and reaches one strategy. A Strategy Bot posts its own URL and body, so each bot can reach a different strategy.
- Does TrendSpider set the order size?
- No. There is no quantity variable, and Nyria ignores a quantity key on an entry alert. Each bot sizes its own orders from its settings.
- What does it cost?
- Paper is free. Live trading from $15 a month.
TrendSpider alerts, by broker
TrendSpider to Schwab
Stocks and ETFs, Options up to 4 legs
TrendSpider to Tradier
Stocks and ETFs, Options up to 4 legs
TrendSpider to tastytrade
Stocks and ETFs, Options up to 4 legs, Crypto spot
TrendSpider to Alpaca
Stocks and ETFs, Options up to 4 legs, Crypto spot
TrendSpider to Nyria Paper
Stocks, options, crypto, free
Guides
Automate trading alerts into broker orders
What an alert is, three ways to automate it, and what to check before you trust it.
Automate options alerts
Single legs and spreads up to 4 legs, from any alert source to your broker.
Send alerts from your Python script to your broker
The webhook URL, the documented fields, a minimal requests sender, the response and the Logs tab, paper first.
Test the strategy on a paper bot first
Paper is free. Live trading from $15 a month.