From market data to exchange orders

How Does a Trading Bot Work? Understanding the Mechanics

Explore built-in strategies

In brief

A trading bot reads market data, checks it against a strategy’s rules, and sends buy or sell orders to an exchange when the conditions are met. It then checks what happened to those orders and uses the updated position and market data to decide what to do next.

A closer look

You choose the strategy, trading pair, and settings. The bot handles the repeated checks and order requests. Gunbot lets you start with built-in strategies and adjust their available settings.

From market data to a trade

A bot can spend much of its time waiting. A price change alone may not be enough: the strategy may also need a signal, available balance, and room within its position limits.

  1. Read the market

    The bot receives exchange data. Depending on the strategy, that can include prices, candles, volume, and the order book. Indicators turn some of that data into signals.

    Timeframes and order types
  2. Check the rules

    The strategy checks entry or exit conditions and applies its configured controls, such as order size and position limits. If the conditions are not met, it waits.

    Explore strategy behavior
  3. Send an order

    When the rules allow a trade, the bot sends an order request through the exchange API. The exchange handles the request. An order may remain open, fill partly, or be rejected.

  4. Follow the result

    The bot checks order and balance updates. The strategy can then respond to the position it actually holds: wait, place another order, or manage an exit.

Repeat with updated market and account data
A simplified view of automated trading. The exact checks and order handling depend on the strategy and exchange.

An example: buying BTC and managing the position

For a simple example, imagine a spot setup with three rules: buy a fixed amount of BTC below a chosen entry price, keep the total holding within a position limit, and sell when a chosen exit target is reached.

When the price reaches the entry level, the bot checks whether another purchase is allowed. If the position limit has already been reached, it waits. Otherwise, it requests a buy order. Once the exchange reports a fill, the strategy uses the updated holding to manage what happens next.

After buying, the setup keeps watching for its exit target. A price change alone does not trigger a sale. A different strategy might use a trailing exit, add to the position, or sell in stages. Those choices come from the strategy and its configuration.

This is why two bots watching the same market can trade differently. Their rules, timeframes, order sizes, and existing positions can all differ.

What you control in Gunbot

Choose the trading pairs and a strategy suited to the behavior you want to automate. Then review the settings that determine when it can enter, how much it can buy or hold, and how it exits. The available controls differ between strategies.

Some strategies adjust their behavior as prices and positions change. That behavior is part of their logic; it does not mean the bot independently chooses a better strategy.

The trading core needs to keep running with an exchange connection for the strategy to continue processing the market. Automation repeats your chosen logic; you still need to understand the setup and monitor its operation.

Try the behavior before using real funds

Start by exploring the built-in strategies and reading the guide for the one you choose. Use historical backtesting to compare settings and market periods. For spot strategies, Simulator mode lets you watch the same Gunbot runtime operate on current exchange data with virtual balances and simulated orders.

Look at the path through the test: entries, position growth, waiting periods, and exits. A final profit figure alone does not explain how the strategy behaved, and simulated results do not guarantee the same outcome in real trading.

If you want to define trading logic beyond the available settings, custom JavaScript strategies provide that option. You can start with built-in strategies without writing code.

Gunbot documentation

Explore the strategy and settings

Use these guides to connect the trading process to the controls in your own setup.

Been using Gunbot for 3 years now! 💎 Huge thanks to the Gunbot team for creating such an amazing bot and consistently delivering awesome updates. Keep up the great work! ❤

IMMD
Trader

The most effective crypto trading software is Gunbot; I tested several other platforms, and none matched its performance—yes, I tried the others during a bull run and still got not the best result as with Gunbot!

AL2021
Trader

Bought Gunbot in November, fumbled with Sim in December... Kicked off real trading last month... And after 1 month I made back the ultimate lifetime licence cost 2 times. Thanks for your great software @GuntharDeNiro and to all those who helped make it stronger with new strategies and feedback for improving the systems over the years. This is the best bot I have seen in terms of control we have as a user.

Didier
Trader
Gunbot Unlimited

Full Gunbot access. One subscription.

Full access to every Gunbot feature, with ongoing updates.

  • The full Gunbot toolkitBuilt-in strategies, DeFi, BitRage arbitrage, visual backtesting and Gunbot Replay.
  • Built for active tradersAutomate, test, analyze, and manage multiple bots from one modern workspace.
  • Always up to dateGet ongoing product improvements, security updates, and new Unlimited features as they ship.
Legacy license holdersAlready own a lifetime Gunbot license?

See your upgrade offer for Gunbot Unlimited.

For existing registered lifetime owners only.
View upgrade offer
Bot runs on your own deviceMonthly or prepaid billingWindows, Mac, and Linux
Full access
Subscription

Gunbot Unlimited

$ 29/month
Full access to every Gunbot feature, with ongoing updates.
  • ✓Spot, futures, DeFi, and arbitrage
    Use the complete Gunbot trading toolkit across centralized and decentralized markets.
  • ✓Unlimited exchange access
    Trade on all supported exchanges with unlimited API keys and exchange connections.
  • ✓Multi bot workspace. Cloud or self hosted.
    Easily manage trading bots through a single, modern interface. Use our hosted version, or run it from your own hardware.
  • ✓Large trading strategy library
    Use the full library of built-in spot, futures, grid, DCA, trend, and custom strategy workflows.
  • ✓AI agents for strategy development and bot review
    Review bot activity, prepare settings drafts and develop custom JavaScript. Connect your own AI provider; API usage may incur separate charges.
  • ✓MetaTrader 4/5 & NinjaTrader 8 integrations
    Run Gunbot automated trading strategies with either platform. Broker, platform and market-data access are separate.
  • ✓Advanced backtesting toolkit
    Backtest strategies with historical market data, trade-path charts, and performance metrics before deploying live.
  • ✓Arbitrage and risk management
    Access arbitrage workflows plus capital controls, stop limits, DCA safeguards, and automated risk rules.
  • ✓For Windows, Mac, Linux
    Runs locally on all major desktop systems.
Get Gunbot Unlimited

Secure payments. Cancel anytime.

Need help understanding a Gunbot strategy?

Contact support