Guide / Checked Nov 2026
How do I set the order size from a TradingView alert?
You don't set it in the alert. Each Nyria bot sizes its own orders, either from a Budget per entry in dollars or from a fixed number of shares, contracts or coins. A quantity or notional key on an entry alert is ignored, and {{strategy.order.contracts}} is reference only. The one exception is MODIFY, which can re-size a resting limit that is still working at Tradier or Alpaca.
Official documentation
Size the bot, not the alert
- 1
Leave size out of the alert
Send the ticker and the action. The strategy placeholders can stay, and Nyria reads {{strategy.order.contracts}} as reference only.
- 2
Pick Size by on the bot
Select Deploy bot. Under Size by, choose Budget per entry or Number of shares.
- 3
Set a Budget per entry
Each entry spends up to this amount per ticker in the alert. If the account can't cover it, the bot skips the entry rather than buying less.
- 4
Or set a unit count
Every entry opens that many shares, contracts or coins. A paper bot always offers it. A live bot needs the strategy's max cost per unit.
- 5
Check the quantity on paper
Run the bot on Nyria Paper and read the quantity on each order in the Logs tab. It shows how Budget per entry sizes each order.
- 6
Mind the total
Your live bots' budgets per entry add up to your total entry allocation, which sets your plan tier.
Messages to copy
Order fills only message
{
"action": "{{strategy.order.action}}",
"instrument": "{{ticker}}",
"marketPosition": "{{strategy.market_position}}",
"prevMarketPosition": "{{strategy.prev_market_position}}",
"contracts": "{{strategy.order.contracts}}",
"price": {{close}}
}Two ways a bot sizes
- Budget per entry is the default and works on every strategy.
- The budget applies per ticker in the alert. $500 with two tickers can spend $1,000.
- Number of shares opens a fixed count. For spreads, 2 enters 2 whole spreads.
- Crypto counts can be fractions. Shares and contracts are whole numbers.
- With Allow multiple entries on, each stacked entry spends the full budget again.
What the alert can still change
- The order type and price, on an alert that names action and direction.
- MODIFY re-sizes a working order at Tradier or Alpaca. Charles Schwab and tastytrade refuse it.
- Nyria Paper fills or refuses at once, so it never has a working order to modify.
Questions
- Can the alert say how many shares to buy?
- No. A quantity or notional key on an entry alert is ignored. Budget per entry or the share count decides.
- How do I set quantity in a TradingView webhook alert in Pine Script?
- Leave it to the bot. Any qty of 1 or more works in the script, including the default. Nyria reads the action and direction and sizes from the bot.
- What happens when the budget can't buy one share?
- The bot places nothing and logs that one share costs more than its budget per entry. Raise Budget per entry to at least that cost.
- Does the budget scale with my account balance?
- No. Each entry spends up to the budget whatever the balance. If the account can't cover it, the entry is skipped.
- What does it cost?
- Paper is free. Live trading from $15 a month.
Next
- Paste an alert into the alert tester to see how Nyria reads it.
- Write a TradingView message with the alert builder.
- Step by step for one account: how to automate TradingView to Alpaca.
- Step by step for one account: how to automate TradingView to Tradier.
- Nyria for developers.
Guides
How do I automate trading on a small account?
What $15 a month buys, why budget per entry is the number that matters, a worked example on paper then live.
Webhook trading bot for stocks
A URL that turns an alert into a share order at your broker, with the paper run first.
Swing-trade stock alerts with position sizing
A dollar budget per entry or a share count, whole shares, held until the exit alert.
How do I auto execute trades from a TradingView strategy?
An alert on the strategy, Order fills only, and the strategy placeholders in the message.
How do I send a limit order from a TradingView alert?
order_type limit plus a price, on an alert that names action and direction.
Try a paper bot first
No card required. Paper is free. Live trading from $15 a month.