Skip to content

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. 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. 2

    Pick Size by on the bot

    Select Deploy bot. Under Size by, choose Budget per entry or Number of shares.

  3. 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. 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. 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. 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

Try a paper bot first

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