A bot that works in a backtest is not a bot that works with real money. Between the two sit imperfect data, different execution, coding errors and the emotions that show up once the money is yours. This guide describes a phased process for testing an automated strategy carefully, and it starts with an honest warning: most retail bots are not profitable, and this information is educational, not a promise of results or a recommendation.
A warning first: most bots do not work
Automation does not create an edge that was not there. A bot runs a rule quickly and without emotion, but if the rule has no statistical edge after costs, it will lose money with the same discipline a person would. Bots sold with promises of guaranteed returns deserve suspicion, and backtest results shown in ads rarely include realistic costs.
The goal of the phases below is not to “prove” your bot wins, but to give it many chances to fail with fake or minimal money, so you find the defects before they get expensive. If the bot survives an honest process, you will have reasonable confidence; if it does not, you will have saved money.
Phase 1: backtest with realistic data and costs
A backtest simulates the strategy on historical data. To be useful, include spread, commission, swap and a prudent slippage assumption; use quality data with the same time conventions as your broker; set aside a stretch of data you did not use for optimization (out-of-sample); and avoid tuning so many parameters that the result is just luck. We have a dedicated guide on overfitting, the most common mistake in this phase.
A backtest result is a hypothesis, not proof. Write down its key metrics (expectancy per trade, win rate, maximum drawdown, number of trades), because they become the benchmark for the next phases.
Phase 2: forward test on demo
A forward test means letting the bot trade in real time on a demo account, with the same rules, the same size and the same conditions you would use live. Do not change parameters during the test: every change restarts the clock, because earlier data no longer belongs to the same strategy.
You need enough trades for the average to mean something. With 30 trades, the standard error of the win rate is about 9 percentage points (√(0.5 × 0.5 ÷ 30) ≈ 9.1%); with 100 it falls to 5%, and with 200 to about 3.5%. A reasonable criterion is to require at least 100 trades and several weeks covering different market regimes (trend, range and news).
Phase 3: live at minimum size
If the forward test meets your criteria, move to a real account at the smallest possible size (for example, 0.01 lots or one micro contract) with capital you are prepared to lose entirely. The aim of this phase is not to make money but to measure the gap between demo and live: execution, costs and the bot’s behavior.
Only after a period without surprises (another stretch of trades and weeks) do you scale the size gradually, for example doubling at most once the criteria are met again. Scaling suddenly after a good streak is the automated version of overconfidence.
Differences between demo and live
A demo often fills with unlimited liquidity, no slippage and low latency; live, orders can be filled at a different price (slippage), rejected or repeated at a new price (requote), arrive late because of latency and meet wider spreads during volatile moments. Large orders can also be partially filled.
The demo also does not reproduce psychological pressure, even though the bot feels none: you are the one who decides to switch it off after three losses in a row. That is why you should fix the shutdown rules before you begin. Assume live results will be somewhat worse than demo results, and design your criteria with that margin.
What to record during the test
Record each trade with its time, instrument, expected price and actual fill price, the spread at that moment, the commission, the result in R and the reason for entry and exit. Also record system events: reconnections, rejected orders, API errors, response times and any manual intervention.
Compare weekly with the backtest: number of trades, expectancy, win rate and drawdown. A small gap is normal; a large and persistent one points to a data, cost or logic failure. Our trading journal lets you store and review this data in your own browser.