How to paper trade with a bot before risking real money
Paper trading is the bridge between a backtest that looks great and a live bot that actually works. It runs your real strategy against real, live market data — but with simulated money, so a bug or a flawed edge costs you nothing but time. A backtest proves your idea worked on history; paper trading proves your code works on the live, messy present, including the data feeds, latency and order logic the backtest never tested. This guide covers the three ways to paper trade a bot, exactly what to watch for, and the code.
Why paper trade at all
A backtest answers “did this strategy work on past data?” Paper trading answers a different, equally vital question: “does my actual running bot work right now?” It catches bugs a backtest cannot — a misaligned timestamp, a wrong order size, a crash on a missing candle, a feed that drops out. It also exposes the gap between assumed and real slippage. It is the heart of forward testing.
Three ways to do it
You can paper trade three ways: (1) an exchange testnet/sandbox that mimics the real API with fake funds; (2) a simulation shim in your own code that fetches live prices but only logs orders instead of sending them; or (3) a platform’s built-in paper mode (Freqtrade’s dry-run, for instance). All three trade live data with no real money — see the paper trading guide for the bigger picture.
Using an exchange testnet
python · paper_testnet.pyimport ccxt
ex = ccxt.binance({'apiKey': TKEY, 'secret': TSECRET})
ex.set_sandbox_mode(True)
# orders here use fake funds but the REAL order API
ex.create_market_buy_order('BTC/USDT', 0.001)
A paper-trading shim
python · paper.pyclass PaperBroker:
def __init__(self, cash):
self.cash, self.pos, self.fills = cash, 0, []
def buy(self, price, qty, fee=0.001):
cost = price * qty * (1 + fee)
if cost <= self.cash:
self.cash -= cost; self.pos += qty
self.fills.append(('buy', price, qty)) # log, don't send
The shim mirrors your live broker interface so the strategy code is identical — only the broker swaps. Include fees and a realistic slippage assumption or the paper results will flatter you.
What to watch for
Compare paper fills to where the market actually was: persistent slippage means your live edge is thinner than the backtest. Watch for crashes, missed candles, duplicate orders and timestamp drift. Confirm your logging captures every decision so you can debug. The goal is a boring, bug-free run before going live.
How long to run
Run paper trading long enough to span different market conditions — at least a few weeks, ideally including a trending and a choppy stretch and a few dozen trades. A bot that survives a month of live paper trading without bugs and roughly matches its backtest expectations has earned a small real-money allocation. Then keep risk tiny at first.
Frequently asked questions
What is paper trading with a bot?
Paper trading runs your real trading strategy against live market data but with simulated money, so no real funds are at risk. It proves that your actual running bot — its data feeds, order logic, sizing and restarts — works in the live present, which a historical backtest cannot verify. It is the essential bridge between backtesting and going live.
How do I paper trade a bot?
There are three main ways: use an exchange testnet or sandbox that mimics the real API with fake funds, build a simulation shim in your own code that fetches live prices but only logs orders instead of sending them, or use a platform’s built-in paper mode such as Freqtrade’s dry-run. All three trade live data with no real money.
Why does my paper trading differ from my backtest?
Differences usually come from real-world frictions a backtest glossed over — actual slippage, fees, latency, missed or delayed candles, and timestamp alignment. If paper fills are consistently worse than the price your backtest assumed, your live edge is thinner than it looked, which is exactly the kind of gap paper trading exists to reveal before real money is involved.
How long should I paper trade before going live?
Run paper trading long enough to span different market conditions — at least a few weeks, ideally covering both a trending and a choppy stretch and several dozen trades. A bot that runs a month without bugs and roughly matches its backtest expectations has earned a small real-money allocation, after which you should keep position sizes tiny at first.