What Is a Trading Bot and How Does It Work?

By Gregory Walsh — Managing Director, Syndicated Finance · Published August 31, 2026 · 7 min read

A trading bot is a computer program that follows a fixed set of rules to decide when to buy or sell something, then sends those orders to a broker without a person clicking the button each time. It works in a loop: collect prices, check the rules, decide what the account should hold, compare that with what it does hold, and place the orders needed to close the gap. A bot does not know anything a person could not know; its advantage is that it applies the same rules every time, on schedule, without hesitation or second-guessing.

The basic loop every trading bot runs

Strip away the marketing and almost every trading bot does the same five things.

  1. Gets data. Usually prices, sometimes volume or other market measures. A bot that trades daily might fetch closing prices once a day. A bot that trades gold hourly fetches hourly prices.
  2. Applies its rules. The rules turn data into a decision. "If the price is above its 200-day average, hold the fund; otherwise hold cash" is a complete, if simple, rule set.
  3. Decides a target. The output is usually a target portfolio: hold 100% of fund A, or 60% of stock B and 40% of bonds, or nothing.
  4. Compares target with reality. The bot reads what the account currently holds and works out the difference.
  5. Places orders. It sends buy and sell orders to the broker to move the account toward the target, then records what happened.

Then it waits until the next scheduled check and starts again.

What the rules can look like

Trading bot rules come in a few broad families. The table below describes the categories, not specific products.

Rule family Idea in one line Typical weakness
Trend following Buy what is rising, step aside when it falls Gets chopped up in sideways markets
Momentum rotation Hold whatever has been strongest recently Late to turns, can concentrate in one area
Mean reversion Buy after sharp drops, expecting a bounce Keeps buying in a real collapse
Breakout Wait for a quiet period, trade the move that follows Many false breakouts
Rebalancing Keep fixed weights across a set of holdings Only as good as the list it holds
Market-maker or arbitrage Profit from tiny price gaps Needs speed and infrastructure most people lack

Many real bots mix families. A rotation bot might add a trend filter so it only holds growth funds when the overall market is healthy. You can read more about two of the most common families in momentum and trend following.

What a trading bot is not

A bot is not a crystal ball. It cannot see the future, and its rules were designed using the past. Whatever edge it has, if any, comes from applying a reasonable idea consistently.

A bot is also not artificial intelligence in the science-fiction sense, even when it is marketed that way. Some bots use statistical models or machine learning, but many retail bots are simply rule-based: clear conditions that a person could write on an index card. That clarity is useful because you can understand why it made each trade. The difference between rules and judgment is covered in rule-based vs discretionary trading.

Finally, a bot is not a broker. It does not hold your money. It connects to a broker that does, and asks that broker to place trades.

How a bot connects to your money

There are two common ways a retail trading bot reaches a market.

Through a broker's API. Many modern brokers let outside software place trades through an API, usually after you sign in on the broker's own page and grant permission (a process called OAuth). The permission can be limited. For example, a bot might be allowed to place trades and read positions but not move or withdraw money.

Through software on your own computer. Platforms such as MetaTrader 5 let you run a small program, called an Expert Advisor, inside your trading terminal. The program reads prices and places trades in your own account. The bot provider may send it signals, but the trades happen in your terminal. Our MT5 Expert Advisor guide explains how that setup works.

Either way, you should know exactly what the bot is allowed to do. Being able to trade is very different from being able to withdraw.

The safety layer most people do not see

The decision rules are the interesting part, but the checks around the orders are what keep a bot from doing damage. A careful bot checks before every order run:

  • Is the account allowed to trade? Subscription active, consent given, account connected.
  • Is the signal fresh? A decision made on stale data should not be acted on.
  • Is it too close to the market open? A cutoff prevents rushed orders.
  • Can this fund still be traded? Funds can be closed or halted.
  • Does a price gap look like a stock split? A split can make a price appear to drop 75% overnight; a naive bot might treat that as a crash and sell.
  • Has this order already been sent? A unique order ID prevents a network retry from trading twice.

There should also be a kill switch: one control that stops all broker orders immediately. If a bot you are considering has no clear answer to these points, treat that as a warning. See how a trading bot places orders safely for more detail.

A concrete example: the five AlgolaneBots strategies

AlgolaneBots runs five rule-based strategies. Every customer gets the same rules; nothing is tailored to an individual. Here is what each one checks and trades:

Strategy Market How often it checks What it trades
Gold Breakout Gold Every hour Gold (XAUUSD), long or short
Leveraged Growth US leveraged funds Every trading day TQQQ, SQQQ, SOXL, TECL, UVXY, SVIX, bond funds and others
Market Switch US funds Every trading day SPY, UVXY, TQQQ, SPXL, SOXL and others
Big Tech Trend US stocks and funds First trading day of each month NVDA, TSM, QQQ, SMH, BIL, GLD and others
Steady Growth US stocks First trading day of each week NVDA, GLD, COST, LLY, MCK, FIX, AXON

Several of these use leveraged funds such as TQQQ, which aim for three times the daily move of the Nasdaq 100 and reset each day. That daily reset means they can drift far from three times the index over longer periods, especially in choppy markets. UVXY, a volatility fund, has lost most of its value over long periods, which is why strategies only hold it briefly. The strategies section shows each one's historical backtest next to its benchmark and its specific caveat.

What a bot can and cannot do for you

It can:

  • Apply rules on a fixed schedule even when you are busy or asleep.
  • Remove the temptation to skip a trade because the news looks frightening.
  • Keep a complete record of every decision.

It cannot:

  • Make a strategy profitable if the rules are not.
  • Avoid losses. Every strategy, automated or not, has losing periods, sometimes long ones.
  • Replace your judgment about whether a strategy suits you, how much to put in, or when to stop.

How to try one without risking money

The safest first step with any bot is paper trading: letting it run on a pretend account using real prices. AlgolaneBots gives each new account a free 90-day trial on a $10,000 paper account. The trial starts when you press start, not when you sign up, and no card is needed. Paper fills happen at the next real market open with a 0.05% cost on each fill, so the results reflect realistic trading. If you want to learn what to watch for during a trial, see the best way to test a trading bot.

Related reading: algo trading explained and what AI trading bots really do.

Key takeaways

  • A trading bot is a program that follows fixed rules to decide trades and sends orders to a broker automatically.
  • Every bot runs the same loop: get data, apply rules, set a target, compare with holdings, place orders.
  • Most retail bots are rule-based, not science-fiction AI, and their rules come from studying the past.
  • The safety checks around orders, and what permissions the bot has at your broker, matter as much as the strategy.
  • Paper trading with real prices is the lowest-risk way to see how a bot behaves.

This is general education, not personal financial advice.

See a bot work on paper

Reading about a trading loop is useful; watching one run is better. Sign up for a free AlgolaneBots account and run all five strategies on a $10,000 paper account for 90 days, then check the safety features that apply if you ever go live.

Where the numbers come from: every strategy figure is from AlgolaneBots's own historical backtests, run on past prices with the method on how we test. Nobody earned them, and future results will differ. General market facts are checked against regulator and company sources. This guide is general information, not personal advice. Read the risk disclosure and how we write our guides.

Keep reading

Automated trading basics · 7 min read · Priya Sharma

AI Trading Bots: What They Really Do

What does an AI trading bot really do? Most use fixed rules or machine learning on past prices. Learn the difference, the overfitting risk and what to check.

Automated trading basics · 8 min read · Daniel Kowalski

Algo Trading Explained: How It Works

Algo trading means a computer places trades by rules written in advance. Learn how it works, the main strategy types, the real risks and how to test it.

Automated trading basics · 7 min read · Vikram Patel

Momentum and Trend Following, Simply Explained

A trend following strategy buys what is rising and steps aside from what is falling. Learn how momentum rules work, where they fail, and how bots apply them.