Guides How to backtest with bar replay
How to backtest by hand with bar replay
Bar replay hides everything after a bar you choose and gives it back one bar at a time. Traded as it unfolds, a past day becomes practice without the hindsight; done with written rules and a record of every trade, it becomes a manual backtest. This guide sets a session up in AlphaChart, walks through it and reads the report.
Why replay, and not scrolling back
Scroll back through a chart and every setup looks obvious, because the outcome is already on the screen. That is hindsight, and it makes a past chart a poor judge of a method. Replay removes the outcome: the chart stops at the bar you choose, and the future arrives one bar at a time. You decide with what you would have known then, and the result is honest.
That gives replay two uses. As practice, it gives you many repetitions of the decisions you make live, in an afternoon. As a manual backtest, it measures how a set of rules performed, trade by trade, when the rules are written down before you start.
Write the rules first
A backtest tests rules; without them it only tests how you felt that day. Before the first bar, write down:
- The market and interval, and which stretches of history: trends, ranges, quiet days and busy ones.
- The entry: what has to be true, and what kind of order you use.
- The stop: where the idea is proven wrong.
- The exit: a target, a trailing rule or a time limit.
- The risk per trade, so each trade is sized the same way (see how to calculate position size).
- The sample: how many trades you will take before you judge the result.
Keep the rules fixed for the whole sample. Changing them halfway starts a new test.
Set a session up
- Open the market and interval you wrote down.
- Press Replay in the top bar and click the bar to start from. Everything after it disappears.
- Open the account settings (the gear on the replay bar) to set the starting balance and a commission per execution, in %. Changes apply from the next session, or at once with Restart session now.
Choose the starting bar without studying what comes after it: jump to the day with Go to date (the calendar in the bottom bar, or Alt + G), click a bar a little before where you want to start, and let replay hide the rest.
Trade it bar by bar
- Forward one bar reveals the next bar (Shift + → on a keyboard). Play reveals them one after another at 0.5× to 10× speed, and Shift + ↓ plays or pauses.
- The order panel at the side of the chart trades the replay’s account: Buy or Sell at market (the latest close), or with a Limit or Stop price, for a size in the asset, in money or as a share of the account risked at the stop.
- Its take profit and stop loss show the profit or loss at each and the reward to risk; every price of the order is also a line on the chart you can drag.
- Close the position or cancel orders at any time; a take profit or stop loss fills on the bar that reaches it.
Step bar by bar around your decisions, and play through the stretches where nothing in your rules can happen. Write down why you took each trade, or why you didn’t take one your rules allowed. That note is what you learn from afterwards.
Read the report
Summary on the replay bar opens the report at any time, and it opens by itself when you leave a session with trades you have not reviewed yet.
- Net profit, after commission, in money and as a share of the starting balance.
- Percent profitable: winning trades out of all closed trades.
- Profit factor: what the winners made divided by what the losers lost. Above 1, the session made money.
- Max drawdown: the deepest fall of the account from a high.
- Average trade: the net divided by the number of trades, and how long trades were held.
- The equity curve against buy and hold over the same bars, and the drawdown under it.
Performance summary splits the figures into longs and shorts, List of trades shows each entry and exit, and Download trades (CSV) saves them for a spreadsheet.
How many trades before the numbers mean something
Very few trades say almost nothing. Five trades with a 40% win rate and five with 80% can come from the very same rules by luck alone. A few points to keep in mind:
- Collect dozens of trades per setup before judging it, and more for rare setups or wide targets.
- Spread them over different conditions. Rules tested only on a trend will look better than they are.
- Count the expectancy, not the win rate. The average result per trade, in money or in multiples of the risk, tells you whether the rules make money; the win rate alone does not.
- Keep the losers in. Skipping the setups that “obviously” failed is hindsight coming back through the side door.
Keep the record
If the trading journal is set to add bar replay trades, every trade you make in replay goes to its Bar replay account, dated in the past. There it gets the journal’s statistics, its R multiples and its notes, in an account of its own, apart from your live and paper trades. Session by session, the practice becomes a record you can review.
What replay can’t simulate
- Fills are kinder than real ones. Inside a bar, AlphaChart assumes price went from the open to the low and then to the high on a rising bar (the high first on a falling one), and fills orders at their price when that path reaches them; a gap past an order fills it at the open. There is no spread, no slippage and no queue.
- Your orders don’t move the market. A size that would move a thin market fills in full.
- There is no real money at stake. Hesitation, fear and boredom are part of live results; replay can’t reproduce them.
- The past is one sample. Rules that worked over one stretch of history can stop working. A backtest tells you how rules behaved, not how they will.
Try it in AlphaChart
- Open a chart, any market and any interval.
- Press Replay in the top bar and click a past bar.
- Step with Shift + →, trade from the order panel at the side, and open Summary when you are done.
Bar replay is free on every market and interval, intraday included. More on the feature: Bar replay.
Questions
Is manual backtesting with replay as good as an automated backtest?
It measures something different. An automated backtest runs exact rules over a lot of history quickly; replay tests rules that need judgement, and your own execution of them. Many traders use replay to shape an idea before writing it down as exact rules.
How far back can I replay?
As far as the market’s history goes in AlphaChart. Scroll back to load older bars, then start the replay from any of them.
Do replay trades count in my journal statistics?
Only if the journal is set to add them, and then in their own Bar replay account, apart from live and paper trades.
Why did my stop fill at a worse price than I set?
Price opened past it: a gap past an order fills it at the bar’s open, as it would in a real market.
Is bar replay free?
Yes, on every market and interval, intraday included. See Pricing.