Your first strategy
Your first end-to-end trade: connect Nyria Paper in one click, create a strategy, send a test alert, check the bot's order, then close the position.
You build a strategy that buys SPY on {"ticker": "SPY", "action": "buy"} and
sells on {"ticker": "SPY", "action": "sell"}, fire both from a terminal, and
watch a paper bot open and close the trade. No real money is involved.
You need
- A Nyria account at app.nyria.io. The free tier is enough.
- About 15 minutes. The market doesn't need to be open.
- A terminal: macOS, Linux or Windows PowerShell.
Step 1: Connect Nyria Paper
Sign in to app.nyria.io.
In the left sidebar, select Integrations.
Select the Nyria Paper card in the Brokers grid.
Select Create Nyria Paper account.
For what the simulator does and does not model, see Nyria Paper and paper trading.
Tradier and Alpaca have their own paper accounts too. To use one instead, see the Tradier or Alpaca setup guide. Every later step works the same.
Step 2: Create the strategy
In the left sidebar, select My strategies, then Create strategy.
Fill in:
- Strategy name:
First Strategy - Alert source:
Custom webhook(the test alert comes fromcurl)
Select Next to move to What it trades.
Step 2a: Set trading behavior
Asset type: Stocks
Long behavior
- On a long entry alert:
Enter position - Close on exit alerts: on
- Order type:
Market order
Short behavior
- On a short entry alert:
Do nothing
Select Next.
Step 2b: Set access and ticker, then create
Who can copy it: choose Private, then select Next.
Which tickers: type SPY in the ticker search and select the
result. Under Max cost per share, select Use $… to fill in
SPY's current price, then select Next.
Review: select Create draft.
Nyria opens the strategy's detail page on the Integration tab.
Step 3: Copy the webhook URL
Find the URL. It looks like this:
https://trades.nyria.io/webhooks/4f9c2a91b7d34e0fae9c1b6d2e8f0a4c...Select Copy URL. The part after /webhooks/ is the strategy's webhook token.
Paste the URL somewhere you can find it. You need it in step 5.
Treat the URL like a password. Anyone with it can send orders to your strategy. If it leaks, select Rotate token on the same tab: the old URL stops working at once, so update any alert source still using it.
Every field Nyria accepts in the webhook body is in the webhook reference.
Step 3a: Check the alert formats
A new strategy is a draft until its alert formats are checked.
Still on the Integration tab, find the Alert format card. It shows one box per alert this strategy uses. With the behavior from step 2a, that is Long entry and Long exit.
Paste a sample alert into each box, exactly as your alert source will send it. Steps 5 and 7 send these payloads, so use them here:
- Long entry:
{"ticker": "SPY", "action": "buy"} - Long exit:
{"ticker": "SPY", "action": "sell"}
Select Check format.
Every box shows Read, and the strategy is Active.
Step 4: Deploy the bot
A bot places the strategy's orders in one account.
On the strategy page, select Deploy bot.
If the switch at the top says Live, select Paper.
Size: set Budget per entry to 1000 and select Next.
Review: select Deploy on Nyria Paper.
Step 5: Send a test webhook
This is the alert your strategy waits for: one HTTP POST to the webhook URL from step 3, with the long entry from step 3a as its body.
Step 5a: Pick your terminal
macOS / Linux (bash or zsh):
curl -i -X POST 'https://trades.nyria.io/webhooks/REPLACE_WITH_YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"ticker": "SPY",
"action": "buy"
}'Windows PowerShell:
Invoke-RestMethod `
-Uri 'https://trades.nyria.io/webhooks/REPLACE_WITH_YOUR_TOKEN' `
-Method Post `
-ContentType 'application/json' `
-Body '{"ticker":"SPY","action":"buy"}'Replace REPLACE_WITH_YOUR_TOKEN with the webhook token you copied in step 3.
Step 5b: Send it
Run the command. A 200 response with "status": "processed" means Nyria
took the alert. For any other response, see Handle the response.
Step 6: Check the bot
Go back to Nyria.
Open the strategy and select the Logs tab. Within a second, a row shows how Nyria read the alert: SPY, long, entry.
Open the bot (sidebar → My bots → First Strategy) and select the Logs tab. A row for the order follows the strategy log. Expand it for the order id, the quantity and the fill price.
Select the bot's Overview tab. Open positions lists one long SPY position. Nyria buys as many whole shares as the $1,000 budget covers: at $700 a share, that is one share.
If the strategy log is still empty after about 30 seconds, see troubleshooting below.
Step 7: Close the position
Close the simulated long SPY position the same way you opened it, with one webhook call.
macOS / Linux:
curl -i -X POST 'https://trades.nyria.io/webhooks/REPLACE_WITH_YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"ticker": "SPY",
"action": "sell"
}'Windows PowerShell:
Invoke-RestMethod `
-Uri 'https://trades.nyria.io/webhooks/REPLACE_WITH_YOUR_TOKEN' `
-Method Post `
-ContentType 'application/json' `
-Body '{"ticker":"SPY","action":"sell"}'The bot log shows a second row, for the closing order.
The Open positions card is gone from the Overview tab, and the Trades tab shows the closed trade with its realized P&L.
That P&L is simulated. A paper market order pays the quoted spread but takes no slippage, so paper results read better than live. See paper trading.
Next steps
- Connect TradingView. The same strategy takes TradingView alerts. Paste the webhook URL into a TradingView alert's Notifications, under Webhook URL, and use the message format in the TradingView setup guide.
- Add options. Edit the strategy, change Asset type to
Options, and add a leg (for example buy 1 ATM call, 7–31 DTE). The webhook payload stays the same, and Nyria picks the contract from the leg. See multi-leg options. - Connect a real broker. See Schwab, Tradier, tastytrade or Alpaca. The strategy stays as it is. Deploy a second bot on the new broker and the same alert goes to both.
- Read more. Strategies covers every strategy setting. Bots covers the budget per entry, tickers, and pausing and starting a bot.
Troubleshooting
Strategy log shows nothing after the curl
- Check the
curlgot a 200 back. The-iflag above prints the status line, so add it back if you dropped it. - Check you copied the webhook token from this strategy's Integration tab, not another one.
- Check the strategy's Status is
Activeon its detail page.
Strategy log shows the alert but the bot log is empty
- The bot may be paused. Open the bot and check its Status header.
- The alert's ticker may not be in the bot's selected tickers. Open the bot and check Tickers.
Bot log shows an error
One <SYM> <unit> costs $<cost>, more than this bot's $<budget> budget per entry: raise the bot's budget per entry above the price shown.- Anything else: copy the message from the bot log and look it up in troubleshooting, then when an order fails.
Nyria couldn't read the alert
Send it again. If it fails again, check the JSON is valid and has ticker and action.
Clean up
When you are done:
Open the bot, select ⋯, then Delete.
Open the strategy's ⋯ menu and select Delete. Its webhook URL stops working.
Leave Nyria Paper connected. It costs nothing, and the next strategy can use it.
Quick start
Connect Nyria Paper, create a strategy, deploy a bot and send a first TradingView alert, then check the order it placed. No brokerage account needed.
Migrate from TradersPost
Move your TradingView, Discord, and broker setup from TradersPost to Nyria. Your alerts work as they are, with no template to rewrite.