Skip to main content

Algorithmic Trading Explained: From Rule to Backtest to Live

An algorithm is just a rule you are no longer allowed to argue with. Everything hard about it happens between writing the rule and trusting the result.

Step 1: write the rule so a machine can read it

"Buy the dip" is not a rule. "Enter on the break of the first 5-minute candle that closes back above a rising 9-EMA while price is above VWAP, stop under the pullback low, target 1.6R" is. If a condition cannot be evaluated from price data alone, it cannot be automated — which is usually a sign it was never measurable by hand either.

Step 2: backtest honestly

Step 3: the gap between backtest and live

This is where most automated systems quietly fail. The live engine gains a safety rule — a pause after a loss, a filter on choppy tape — that the backtest never modelled. The backtest then says you should be profitable while the account says otherwise, and nobody can explain the difference.

The fix is a parity rule: every rule the live system enforces must also run in the replay, reading the same constant from the same place. When we applied that to our own desk we found three rules that existed only in live trading, and two of them were costing money.

Step 4: the guardrails that make it survivable

Does it beat trading by hand?

At following its own rules, always — that is the entire point. At picking setups, only if the setups had an edge to begin with. Automation removes hesitation, revenge trades and size creep; it does not manufacture an edge that was never there.

See the rails running in public on the live desk, or read do AI trading bots work for the checklist to verify any system before you trust it.