How Trading Bots and Automation Work: Alerts, APIs and Kill Switches

Trading bots range from simple alerts to fully automatic systems. How the pieces connect (signals, webhooks, broker APIs), the limits every bot needs, the rules in India, and how to avoid bot scams.

By StockYatra Team
How trading bots and automation work cover

In short

  • A trading bot is software that turns a signal into an order, with or without you confirming.
  • The chain: signal → alert or webhook → bot logic → broker API → exchange.
  • Every bot needs limits: position size, daily loss, order rate and a kill switch.
  • In India, API and algo orders go through SEBI's algo framework via your broker. Bots sold with guaranteed returns are a red flag.

"Let a bot trade for you" is one of the most advertised ideas in retail trading. Automation can genuinely help, by removing hesitation and enforcing rules, but only if you understand the pieces and their failure modes.

Flow from signal to alert to bot to broker API to exchange, with a kill switch and limits sitting above everything
How a no-code or API trading bot connects the pieces.

The pieces of a trading bot

  • Signal: the rule that says "now". It could be a chart condition, an indicator cross or a price level.
  • Alert or webhook: a message sent when the signal fires. A webhook is an automatic message from one app to another over the internet.
  • Bot logic: checks your rules: is the market open, is the size within limits, is there already a position?
  • Broker API: the broker's programming interface that accepts orders from software.
  • Exchange: where the order is matched.
Four levels of automation: alerts, assisted, semi-auto, full auto
Start at level 1 and move up only after testing.

The four levels of automation

LevelWhat happensWho is in control
1. AlertsThe app notifies you when a rule firesYou decide and place the order
2. AssistedThe order is pre-filled with size and stop-lossYou confirm each order
3. Semi-automaticThe bot places orders within your limitsYou monitor and can stop it
4. Fully automaticRuns without you watchingYour limits and kill switch
Key idea: A bot with no daily loss limit and no kill switch is the riskiest part of your trading.

Limits every bot needs

  • Maximum position size per trade and in total.
  • Maximum daily loss after which the bot stops.
  • Order rate limits to catch loops that fire again and again.
  • Price sanity checks: refuse orders far from the last price.
  • A kill switch: one action that stops the bot and cancels open orders.
  • Logs of every decision, so you can find out what went wrong.

The 2010 Flash Crash began with an algorithm that did exactly what it was told, with no regard to price. Limits exist for that reason.

Rules to know

India: under SEBI's retail algo framework, orders sent through broker APIs carry exchange-issued identifiers, brokers must control API access (for example static IPs and two-factor login), and providers of hidden-logic "black box" algos must be registered research analysts. See SEBI white box vs black box rules.

US and elsewhere: brokers set their own API terms, and regulators repeatedly warn about bots that promise high or guaranteed returns.

Bot scam red flags

  • Guaranteed daily or monthly returns.
  • You must send money to the "bot operator" rather than keep it in your own broker account.
  • Screenshots instead of verifiable, broker-statement results.
  • Pressure to recruit friends or upgrade to "VIP" tiers.

Read the full list: AI trading bot scams: 10 red flags.

Practise automation thinking first

Before automating anything with real money, make sure your rules work. StockYatra's Pro Chart lets you build rules without code (with stop-loss and target), write Pine Script, and backtest on NEPSE, NSE and US practice charts, with every signal drawn. It does not connect to a real broker; it is the safe place to test the logic.

Key takeaways

  • Bots link a signal to an order through alerts, webhooks and broker APIs.
  • Move from alerts to full automation step by step, only after testing.
  • Hard limits and a kill switch matter more than the strategy.
  • Guaranteed returns and handing over your money are scam signs.

Test the logic before you automate

StockYatra is a free practice app for Nepal (NEPSE), India (NSE) and US stocks. Write rules, test 41 transparent strategies or your own Pine Script in Pro Chart, backtest them on the chart, and practise with virtual coins. Nothing is real money.

Get StockYatra See Pro Chart

More on algos, HFT and quant

StockYatra is an education app, not a broker, adviser or research analyst. Nothing here is a recommendation to buy or sell any security or to use any trading product. Case summaries are based on public orders and press reports; allegations are not findings, and outcomes can change on appeal. Practice prices are simulated and coins are virtual.

Frequently asked questions

How does a trading bot work?
It watches for a signal, applies your rules and limits, then sends an order through a broker's API. Simpler bots only send you alerts.
Are trading bots legal in India?
Automated trading through registered brokers is allowed under SEBI's algo framework, which requires algo identifiers, broker controls on API access and registration for hidden-logic algo providers.
What is a kill switch in trading?
A single control that immediately stops an automated strategy and cancels its open orders, used when something goes wrong.
Can a trading bot guarantee profits?
No. Any bot or service promising guaranteed returns should be treated as a red flag.
Does StockYatra run trading bots?
No. StockYatra is a practice app. You can design and backtest rules in Pro Chart, but it does not place orders with a real broker.