Automate TrendSpider trading alerts
Alert source
Nyria reads a TrendSpider Alert or Strategy Bot webhook and places it as an order at your broker, in TrendSpider's own variables.
{
"symbol": "%alert_symbol%",
"action": "buy",
"price": "%last_price%"
}Alerts and bots
Alerts or Strategy Bots
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.
TrendSpider's own variables
alert_symbol, last_price and bot_symbol fill in with percent signs around the name, not the curly braces TradingView uses.
One URL per strategy
Each strategy has its own webhook URL with its own token. Keep it private, and rotate it from the strategy's Integration tab if it leaks.
Set it up
- Copy the webhook URL
- Open the strategy in Nyria, select Integration, and copy its webhook URL.
- Set it in TrendSpider
- Open Account & Settings, check Webhook, paste the URL, and set the method to POST.
- 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.
- One account URL, one strategy
- The account webhook feeds one Nyria strategy. To feed several, use a Strategy Bot per strategy instead.
Code examples
{
"symbol": "%alert_symbol%",
"action": "buy",
"price": "%last_price%"
}{
"symbol": "%bot_symbol%",
"action": "sell",
"price": "%last_price%"
}TrendSpider's variables
TrendSpider fills these in when a webhook fires. There is no action or quantity variable: write buy or sell into each alert, and leave quantity out so your Nyria bot sizes the order.
| Variable | Where | What it is |
|---|---|---|
| %alert_symbol% | Alert | The symbol the alert fired on. |
| %last_price% | Both | The last price when it fired. |
| %alert_name% | Alert | The alert's own name. |
| %alert_note% | Alert | The alert's note text. |
| %price_action_event% | Alert | touch, break_through, bounce, or script_returned_true. |
| %bot_symbol% | Strategy Bot | The bot's symbol. |
| %bot_status% | Strategy Bot | in_position or not_in_position. |
| %bot_name% | Strategy Bot | The bot's own name. |
| %bot_timeframe% | Strategy Bot | The bot's timeframe. |
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. One set to From my rules ignores them and picks the contract from its own delta, strike and expiry settings.
A price in the alert is the limit when the strategy's limit is Alert price. Otherwise Nyria prices from the live chain, and an entry it can't price isn't placed.
Other alert sources
Trade an account you already alert from
Point the account webhook, or one Strategy Bot, at a strategy.