DEV Community

Nyria
Nyria

Posted on Originally published at nyria.io

No-code trading bot: stock and option alerts in, orders out

I write code for a living, and the trading setup I actually run has no code in it. The signal lives in a TradingView chart. The alert is one line of text. The thing on the other end turns that line into an order at my broker. I used to run a VPS with a Flask app in the middle, and I don't miss it.

Disclosure: I build Nyria, which is the thing on the other end here. Everything below is how it actually behaves, including the parts that will annoy you.

Where the alert comes from

Three sources, one destination.

TradingView: an alert on an indicator or a strategy, with the strategy's webhook URL pasted into the alert's webhook field. The message can be plain text.

Discord or Telegram: a channel in a server or group you run. It reads the posts, with an author or keyword filter so chatter does not trade. The post can name the contract itself.

Anything that can POST to a URL: TrendSpider, a Zapier step, your own scanner.

The alert for a stock, or for an options strategy that picks its own contract, is this:

SPY long entry
Enter fullscreen mode Exit fullscreen mode

and the exit is this:

SPY long exit
Enter fullscreen mode Exit fullscreen mode

That is the whole template. Ticker, direction, action. JSON works too if your source speaks it, but for a chart alert I use text so I can read it in the TradingView alert log.

The strategy is a form, and the form decides four things

  1. What each alert does. Four alert kinds: long entry, long exit, short entry, short exit. Under Long behavior and Short behavior you say whether an entry opens a position, closes the other side, or does nothing, and whether exits close. A long-only setup can treat short entries as its exits, which is handy when the indicator only knows "flip".

  2. How the option contract is picked. "From my rules": one to four legs, each finding its strike by delta, by price, by strikes from the money, or by offset from another leg, with buy or sell, call or put, and a DTE range. "Provided in alert": the message names the strike and expiry (Discord, Telegram, your own bot).

  3. Order type, duration and limit target. Market or limit, set separately for entries and exits on each side. A limit takes its price from Bid, Ask, Mid, a custom number, or the price in the alert. Duration is Day, GTC or FOK. Tradier has no FOK, so FOK goes there as Day.

  4. Trading window and stacking. "Limit trading hours" drops entries outside your window and still lets exits through. "Allow multiple entries" is off by default, so a second entry on an open position is skipped and logged, not stacked.

The bot is the strategy on one account with one budget

Deploying a bot is: pick a connected account, set a budget per entry. That is it.

Stocks size in whole shares. $500 on a $50 stock buys 10. Options size per contract, and a contract is 100 shares, so a $2.00 premium costs $200: a $500 budget buys 2 and leaves $100 unspent. If one contract costs more than the budget, the deploy is refused up front when a live quote shows it. You cannot deploy a bot that can never trade.

The same strategy on a second account is a second bot, with its own stats.

A real one, start to finish

Strategy: options, From my rules, one leg: Buy, Call, 0.40 delta, 14 to 31 DTE. Long behavior: Enter position, with Close on exit alerts on. Entries limit at Ask, exits limit at Bid, Day. Bot on the built-in paper broker, $500 per entry.

SPY long entry arrives at 10:14. The bot picks the listed SPY call closest to 0.40 delta inside 14 to 31 DTE with a live quote. The ask is $2.00, so it buys 2. SPY long exit at 2:50 sells the 2 it holds.

What breaks, from my own logs:

  • No contract inside the DTE range within 0.25 of the target delta: entry skipped, nothing placed, the Logs tab says so.
  • Options market closed: the options alert is refused. Stocks on the built-in paper broker fill at any hour, which makes an evening test look fine and a 9:25 AM live alert fail.
  • An exit arrives and nothing is tracked as open, because the bot was paused or I closed by hand at the broker: logged as Skipped, not Failed. It tracks what it placed, not your whole account. Give it an account of its own.
  • Two alerts 100 ms apart can arrive out of order. To flip, send one reversing alert, not an exit and then an entry.

Paper first, and what paper does not prove

The built-in paper broker is free, up to 10 bots. A market order there fills at the quoted bid or ask: it pays the spread, never slips and never partially fills, so paper P&L reads better than live. What a paper run proves is that the alert fires, the text is read the way you meant, each exit closes its entry, and the quantity is what you expected. It cannot see a broker rejection such as an options approval level.

For the broker's own rejections, connect the broker's paper account instead. Alpaca paper takes an API key generated with the dashboard toggled to Paper; keys start with PK, and a live AK key is refused on paper. Tradier sandbox takes the sandbox account number and token from developer.tradier.com, runs on 15-minute delayed data, and on weekends marks resting limit orders as filled at prices that never traded. Read Tradier sandbox results on weekday regular hours only.

Run a week or two. Then deploy on the live account, or edit the bot to point at it. The first live deploy makes you accept the risk disclosure.

What it will not do

Market and limit orders only. No stop or stop-limit, no bracket, no OCO, no trailing stop. A position closes when an exit alert arrives, or when an opposite entry is set to close it, and that is the entire exit model. No futures, no forex; an index alert trades as an option. No guessing at "thinking about SPY?", which places nothing. And no opinion on whether the strategy makes money.

Live brokers: Charles Schwab, Tradier, tastytrade, Alpaca. Paper is free; live is from $15 a month. The strategy settings are documented here. To run the SPY example above on a paper bot, start on Nyria.

Top comments (0)