Connect TrendSpider alerts
Send TrendSpider Alerts and Strategy Bot alerts to Nyria as webhooks, with payloads that use TrendSpider's own %alert_symbol% variables.
Which TrendSpider feature you use decides how many Nyria strategies you can run. Every Alert shares one account-wide URL, so it feeds one strategy. Each Strategy Bot has its own URL, so several bots can feed several.
Before you start
You need:
- A Nyria strategy whose alert source is TrendSpider.
- A bot on that strategy with a connected broker. See the broker pages under integrations.
- A TrendSpider plan that includes webhook alerts. TrendSpider's pricing page lists which tiers do.
Alerts or Strategy Bots
TrendSpider sends webhooks from two places, and they behave differently:
| Alerts (price / indicator / scanner) | Strategy Bots (TrendSpider's automated strategies) | |
|---|---|---|
| Webhook URL | One URL for the whole account (Account & Settings) | A URL and body for each bot |
| Symbol variable | %alert_symbol% | %bot_symbol% |
| Can feed several Nyria strategies | No. Every alert goes to the one account URL | Yes. Each bot can post to a different Nyria strategy |
To run several Nyria strategies from one TrendSpider account, use Strategy Bots.
TrendSpider's variables
TrendSpider fills in these variables when a webhook fires. They're written
%...%, not {{...}} as on TradingView.
Alert webhooks
%alert_symbol%: the symbol the alert fired on%last_price%: the last price when the alert fired%alert_name%: the alert's name%alert_note%: the alert's note text%price_action_event%:touch,break_through,bounce, orscript_returned_true
Strategy Bot webhooks
%bot_symbol%: the bot's symbol%bot_status%:in_positionornot_in_position%last_price%: the last price%bot_name%,%bot_timeframe%
TrendSpider has no action or quantity variable. Write the direction
into each alert, "action":"buy" on a buy alert and "action":"sell" on a
sell alert, and leave quantity out so your Nyria bot sizes the order.
Set up Alerts (one strategy)
Copy your Nyria webhook URL
In Nyria, open the strategy, select the Integration tab and copy the webhook URL:
https://trades.nyria.io/webhooks/YOUR_STRATEGY_TOKENKeep it private. Anyone with the URL can send alerts to the strategy.
Set the account webhook URL in TrendSpider
In TrendSpider, open User Icon → Account & Settings, check the
Webhook box and paste the Nyria URL. Use method POST. The setting
applies to the whole account: every alert you arm posts to this one Nyria strategy.
Put the payload in the alert's note
TrendSpider posts each alert's description or note as the request body, and
sends it as application/json when the note is valid JSON. Paste:
{
"symbol": "%alert_symbol%",
"action": "buy",
"price": "%last_price%"
}Use "buy" on entry alerts and "sell" on exit alerts. TrendSpider fills in
%alert_symbol% and %last_price% when the alert fires.
Test, then arm
Select Send Test Alert in TrendSpider. On the Nyria strategy's Logs tab, check the alert arrived and how Nyria read it. Then set the TrendSpider alert Active, and check the Nyria strategy is Active with a bot deployed.
Set up Strategy Bots (several strategies)
Each TrendSpider Strategy Bot has its own webhook URL and body, so each bot can post to a different Nyria strategy. Use this body:
{
"symbol": "%bot_symbol%",
"action": "buy",
"price": "%last_price%"
}TrendSpider takes a separate body for each event. Give the bot's entry
webhook "action":"buy" and its exit webhook "action":"sell".
%bot_symbol% sends the bot's ticker, so one body covers every ticker the
bot trades.
Options, limit orders and multi-leg
The payload above covers single-leg stock and crypto market orders. For anything else, use the same fields as any other source. A limit order:
{
"symbol": "%alert_symbol%",
"action": "buy",
"order_type": "limit",
"price": "%last_price%"
}order_type:marketorlimit. Leave it out to use the strategy's order type. Nyria reads it on this shape only for a ticker in the strategy's ticker list, and not on an options strategy. Otherwise sendaction(OPENorCLOSE) withdirection, or set the order type on the strategy. See when Nyria readsorder_type.price: required for a limit order.%last_price%is TrendSpider's last-trade price when the alert fired.- For option strikes, multi-leg spreads and dollar-notional crypto, see the webhook reference. With Contract selection: From my rules, send the directional alert above and Nyria picks the contract from the strategy's strike, delta and DTE settings, as it does for TradingView, Discord and Telegram.
How Nyria reads each field
| TrendSpider variable | Webhook field | What Nyria does with it |
|---|---|---|
%alert_symbol% / %bot_symbol% | symbol | Checks it against the strategy's tickers. |
| (written into the alert) | action | Reads it through the strategy's trading behavior. buy and sell are standard; entry, exit, open and close also work. |
%last_price% | price | Uses it as the limit price on a limit order, and ignores it on a market order. |
Troubleshooting
- 404 (or 400): the token in the URL is wrong or malformed. Copy it again from the Integration tab.
- 200 with
"rejected": true: the strategy is not Active. - 200 with
"status": "rejected": the symbol is not in the strategy's tickers, or the direction is turned off. Thereasonsays which. - 422, 500 or 503: the alert reached Nyria but couldn't be processed,
for example a missing
priceon a strategy that takes its limit price from the alert (a500). The strategy's Logs tab has the reason. - Broker rejects the order: Nyria sent it and the broker refused it. The bot log row carries the broker's reason, such as buying power, a ticker it doesn't trade or market hours.
- All my alerts hit one strategy: plain Alerts all post to the one account-level URL. Use Strategy Bots, which each have their own URL, to feed several Nyria strategies.
Next steps
- Webhook reference: every field, with options, multi-leg and crypto examples.
- Alert sources: how TrendSpider compares with TradingView, Discord, Telegram and your own code.
- Trading behavior: what
buyandsellmean inside a Nyria strategy and how exits pair with entries.
Trade alerts from a Telegram chat you run
Link your Telegram account, add the Nyria bot to a group or channel you run, and trade the alerts posted there.
Connect an AI agent to Nyria (MCP)
Connect Claude, ChatGPT, Cursor or any MCP-compatible AI agent to a Nyria strategy so it can preview and send trade alerts.