Automated trading is the use of software to place, manage and close trades according to predefined rules. Once switched on, the system watches the market and sends orders without you clicking buy or sell.
The rules can be simple, like placing a stop order when price hits a level, or complex, like a model that sizes positions across dozens of markets. Systems run on broker platforms, APIs or custom infrastructure and are used across shares, crypto, FX and futures.
What actually gets automated
Automation extends beyond pressing the buy button. A typical rules-based setup covers the whole trade lifecycle:
- Signal generation: The logic that says when to enter or exit. This might be based on price patterns, indicators, order-book signals, seasonality or event data.
- Position sizing: How much to trade, often tied to account equity, volatility or a fixed risk per trade.
- Execution: Converting a signal into one or more orders, choosing price limits, time in force and routing.
- Risk controls: Stops, profit targets, trailing exits, daily loss limits and portfolio constraints.
- Monitoring and housekeeping: Detecting fills, cancelling stale orders, handling partial fills, logging and error handling.
Some traders automate only execution, leaving the decision to trade to a human. Others automate end to end, including research, scanning and post-trade analytics.
How orders are sent and managed
Automated systems talk to a broker or exchange via an API or a trading platform’s scripting language. They translate strategy instructions into order types that venues understand:
- Market orders seek immediate execution at the best available prices, prioritising speed over certainty of price.
- Limit orders specify the worst acceptable price and wait to be filled, which controls slippage but risks missing the trade.
- Stop and stop-limit orders trigger when price touches a level, often used for risk management or breakout entries.
- Time-in-force settings such as good till cancelled, immediate or cancel and fill or kill direct how long an order lives and whether it can be partially filled.
Execution quality depends on market liquidity and the bid-ask spread. The ask price is the lowest price sellers are quoting right now, and the difference between bid and ask is a cost that strategies must overcome. Automation helps by working orders patiently, slicing larger orders and cancelling or replacing orders as conditions change.
Well-built systems also manage the messy bits of live trading: partial fills, rejects, throttling limits, sudden gaps, halts and venue-specific quirks. Providers differ on supported order types, throttling and error messages, so code often includes exchange and broker specific handling.
Strategy styles that fit automation
Many approaches translate naturally into code:
- Trend following and breakouts: Enter on higher highs or moving average rules, ride the move with trailing stops and scale out into strength.
- Mean reversion: Fade short term extremes and exit on a return to average, usually with strict position limits.
- Market making: Quote both sides of the book, adjust spreads as volatility shifts and keep inventory near zero.
- Event or schedule driven: Rules around index rebalances, futures rolls or opening and closing sessions.
- Arbitrage and relative value: Trade price gaps across venues or related instruments where the edge is small and execution discipline is critical. See arbitrage.
High frequency trading is a narrow, speed intensive subset that competes on latency and market microstructure. Many automated traders operate at slower rhythms, from minutes to days, focusing on process consistency rather than microseconds.
Building and testing a rules-based system
Before letting a bot near live money, traders usually follow a build-test-iterate loop:
- Specify the rules: Write down exact entry, exit, sizing and risk logic. If a step is ambiguous for a human, it will be ambiguous in code.
- Gather clean data: Use reliable historical prices and, where needed, corporate actions and contract rolls. Watch for survivorship bias and missing data.
- Backtest with costs: Include commissions, fees, spreads and realistic slippage. Simulate partial fills and the chance of not getting filled.
- Prevent overfitting: Keep the rule set simple, validate on out of sample periods and use walk forward testing when tuning parameters.
- Paper trade and stage in: Run the system on a demo or small size to confirm behaviour under live conditions and logging quality.
Here is a small, realistic example. A moving average crossover system buys when a 20 day average rises above a 50 day average and sells when it falls back. The bot sizes each trade to risk 0.5 percent of equity between entry and a stop placed below recent support. It submits a limit order slightly inside the spread, cancels if not filled within two minutes, then tries a market order if the signal still holds. It tracks a trailing stop and a profit target, and it will not open new trades after a daily loss cap is hit. None of this is complex, but spelling it out makes the code unambiguous.
Where you will encounter it
Automated trading shows up in several places:
- Retail platforms: Many offer scripting or plug in bots for rules based strategies. Features and constraints vary by provider, including minimum order sizes, supported order types and API limits.
- Crypto exchanges: API access is common, so strategies that react to funding rates, order book depth or cross venue price gaps are widely coded.
- Institutional desks: Portfolio and execution algos scale orders across venues, aim to reduce market impact and adhere to pre trade risk checks.
- HFT firms: Co located and latency sensitive systems that infer short term order flow and compete to capture tiny edges many times a day.
Not every automated approach is high speed, and not every algorithm is fully hands off. Some traders keep a human in the loop for turning systems on and off or for rare, high impact decisions.
Risks, safeguards and provider differences
Automation enforces discipline, but it introduces its own set of risks:
- Model risk: A strategy that worked in past data can fail in new regimes. Overfitting is common if rules were tuned too closely to history.
- Technology risk: Power cuts, dropped connections, server time drift and API changes can cause missed fills or duplicate orders.
- Liquidity and slippage: Backtests may assume fills that are not realistic in thin markets or during stress.
- Operational errors: Bugs, rounding issues and wrong instrument identifiers can send unintended orders very quickly.
- Market structure events: Halts, auctions and gap opens can skip stops and create large overnight moves.
Good practice is to include circuit breakers, daily loss limits, a kill switch and comprehensive logging. Many traders set alerts for unusual behaviour, such as a spike in rejected orders or a sudden jump in slippage. Brokers and exchanges differ in pre trade checks, throttles and what happens to resting orders during outages. Regulations also vary by jurisdiction and can change, especially around market abuse controls and testing standards for automated systems.
At its best, automated trading is a way to express a clear process the same way every time. It does not guarantee profits. It does make your rules explicit, testable and repeatable, which is exactly what software is good at.