Skip to content

Guide

How do I send TrendSpider alerts to my broker?

Nyria sends TrendSpider alerts to your broker. Paste a Nyria strategy's webhook URL into TrendSpider, and each Alert or Strategy Bot post becomes an order at Charles Schwab, Alpaca, tastytrade or Tradier. The bot you deploy sizes it. Paper is free.

Send TrendSpider alerts to Nyria in five steps

  1. 1

    Create the strategy, copy the 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. 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. 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. 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.

  5. 5

    Run it on paper, then go live

    Select Deploy bot, choose Nyria Paper and set a Budget per entry. Let real TrendSpider alerts fire and read each order on the Logs tab. Then deploy a second bot on your broker account.

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.

TrendSpider's own alerts guide covers the two alert types, Dynamic Alerts and Multi-Factor Alerts. Its webhooks page says a request times out after five seconds.

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, Alpaca, tastytrade and Tradier; 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. Exits come from your 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 legs the alert names. Each leg needs a side, strike, expiration and buy or sell action. Nyria refuses an entry that leaves one out. 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.

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.

Test it on paper first

No card required. Paper is free. Live trading from $15 a month.