How automated trading works: from signal to live order

9 min read · Updated October 4, 2026

In short
  • An automated strategy is a loop: a new price bar arrives, the program runs your rules, and if they say so it sends an order through the broker's API, then checks what actually filled.
  • Entries usually go in as a market order, with the stop and target placed as soon as the entry fills.
  • Things go wrong in practice: dropped connections, partial fills, slippage, rejected orders, outages. A good runner expects them.
  • Go live in stages: shadow mode (no orders) first, compare with the backtest, then the smallest real size with hard daily limits outside the strategy.

You have exact rules (turning an idea into rules), written as code (Pine Script vs Python), tested honestly (how to backtest). This guide follows what happens when that strategy runs on live prices, one trade at a time, and what has to be in place before real money is involved.

The runner: where the strategy lives

The program that runs your strategy is often called a runner. It can be on your own computer (which then has to stay on and connected for the whole session), on a server, or on a hosted service that runs it for you. Wherever it is, it does the same four jobs: listen to prices, run the rules, send orders, and keep track of what the broker says happened.

One trade, step by step

Say it's an opening range breakout on 5-minute bars, from the example in the rules guide.

  1. A bar closes. At 10:05 New York time the 10:00 bar completes. The broker's streaming connection pushes its open, high, low and close to the runner.
  2. The rules run. The runner adds the bar to the history and calls the strategy. The bar closed above the opening range high, it's within the trading window, and there's been no trade today, so the strategy says: buy one contract, stop at the range low, target at 1.5 times the risk.
  3. Checks before sending. The runner checks the order against limits that sit outside the strategy: the most contracts allowed, the account's daily loss so far, any risk guards. A strategy with a bug shouldn't be able to send a 50-contract order.
  4. The entry goes out. The runner sends a market order through the API. The broker replies with an order id.
  5. The fill comes back. The order fills, a moment later and perhaps a tick or two away from the bar's close. That difference is slippage, and it's why backtests should include it.
  6. The stop and target go in. As soon as the entry is filled, the runner places the stop and the target at the broker. They live at the broker, so they still protect the position if the runner disconnects.
  7. The exit. Price reaches the target. The broker fills it, and the runner cancels the stop so it can't fill later and open a new position by accident.
  8. Reconcile and record. The runner asks the broker for the position and fills, confirms it's flat, and records the trade.
New bar arrivesfrom the price streamRun your rulesenter, exit or waitRisk checkssize, daily loss, guardsSend the orderthrough the broker APIFill confirmedplace stop and targetReconcilematch the broker's recordsnext bar
The loop runs on every new bar. Stops and targets rest at the broker, so they still protect the position if the runner loses its connection.

What goes wrong, and what a runner should do

ProblemWhat a careful runner does
The price stream dropsReconnects, fetches any bars it missed, and checks the position before acting again.
The runner restarts mid-tradeAsks the broker what's open and what's working, and carries on from the broker's truth, not its memory.
An order is rejectedRecords why (closed market, margin, size limit) and doesn't keep retrying blindly.
Part of the order fillsSizes the stop and target to what actually filled.
Fast markets and slippageAccepts it as a cost, and is measured against a backtest that included it.
A bug in the strategyHard limits outside the strategy (size, daily loss) stop the damage, and the trader can switch it off instantly.
The broker has an outageNothing the runner can do; the stop resting at the broker is the protection. Someone should be watching.

From paper to live capital, in stages

1. Shadow mode

The runner does everything except send orders: it runs on live prices and records what it would have done. This catches problems you can't see in a backtest, like signals at odd times, or behaviour around the open and close. Compare its decisions with a backtest of the same sessions. They should match.

2. Smallest real size

When shadow results match, go live with the smallest size the market allows. Micro futures contracts, a tenth of the full size, exist largely for this. You're testing the plumbing now, not trying to make money.

3. Limits outside the strategy

Set a daily loss limit, a maximum number of trades and a maximum size that are enforced separately from the strategy's own logic, so a bug or an unusual day can't run past them. On a prop firm account, set them inside the firm's own limits with room to spare.

4. Keep comparing

Journal every automated trade and compare live results with the backtest regularly. Some drift is normal (slippage, missed fills). A lot of drift means something is different, and it's worth stopping to find out what.

Check the rules first

Before any automation trades real money, read the current rules for your account. Some prop firms restrict automated or API trading, where it may run from, or who may place orders on your behalf, and some don't allow API trading on funded accounts at all. Brokers have terms too. Automating against the rules can cost you the account.

How this works in TradeHarbor

TradeHarbor's automation (in beta) runs your saved strategy on TradeHarbor's servers during market hours, on your broker account linked by API, streaming live bars from the broker. Each automation is a card showing its status, today's results, the open position and every decision it made, with Stop all to switch everything off at once.

In shadow mode it runs on live prices and records what it would do, without placing orders, and Check against backtest replays the completed sessions with the same strategy version and lists any trade that differs. In live mode the runner places the strategy's entries, with their stops and targets, on your account. Switching an automation off closes whatever it opened.

Risk guards are the limits outside the strategy: a daily loss (in dollars or as a share of your firm's daily limit), a profit lock, maximum trades, stopping after losses in a row, maximum contracts, and cooldowns. They apply to every trade on the account, placed by you or by an automation. On accounts linked by API they're enforced live: when one trips, TradeHarbor closes the account's positions, cancels working orders and locks the account until the next session.

Automation is an open beta for Pro members with a linked brokerage account (TopstepX and other supported brokers), from the Automation page in the app. Building strategies in the Strategy lab is open to everyone.

The whole path

Idea, exact rules, code, honest testing, shadow mode, small live size, limits that sit outside the strategy. Each step is in how to automate a trading strategy. Automation won't create an edge, but it trades your rules the same way every time, which is the only way to find out whether they have one.

Build it, test it, then automate it

Describe your idea in TradeHarbor's Strategy lab and see the rules and the Python they become. Test it on real futures history on Pro, then let it trade for you with automation.

Start free

Educational content only. Nothing here is investment, financial, or trading advice, and TradeHarbor is not affiliated with any prop firm or broker mentioned. Trading futures involves substantial risk of loss. Each firm's current published rules always govern.