How to Backtest a Forex Setup With Chart Replay
Learn how to backtest a forex setup with chart replay, clear entry rules, a trade journal and a simple review process before risking money.

In this lesson, you will build a simple XAUUSD example using weekly and daily key levels, 4H market structure, a liquidity grab and an engulfed-plus-engulfing entry. These are example rules for practising. They are not a promise of profit or a claim that this setup suits every trader.
How to backtest a forex setup without hindsight
Hindsight makes old charts look easier than they felt in real time. You can see where price eventually went, so it is tempting to mark a level or entry only after you know the outcome. Chart replay helps you reduce that temptation by advancing through historical candles in sequence.
Before you start, decide what counts as a trade. Write down the market, the timeframes you will use, what must happen before entry, where your stop goes and what will make you exit. Stick to those rules for the whole test. If you change a rule halfway through, record the change and begin a separate test.
For this example, use:
- Market: XAUUSD.
- Context: weekly and daily key levels.
- Setup: a 4H liquidity grab followed by a structure shift.
- Entry idea: an engulfed candle followed by an engulfing candle.
- Exit: a stop at a defined invalidation point and a target you decide before entry.
The exact definitions matter less than applying them consistently. If a rule is too vague to decide whether a trade qualifies, make it clearer before you begin.
Mark weekly and daily key levels first
Start with the weekly chart. Mark levels you can identify from price action, such as a clear swing high or low, or a level where price previously reacted. Then move to the daily chart and mark relevant highs and lows there. Keep the chart readable: the aim is to see where price is in relation to levels, not to cover the chart in lines.
An example: price is approaching a daily low near a weekly level you already marked. That area gives you a place to pay attention. It does not, by itself, tell you to buy or sell. Wait for your lower-timeframe conditions rather than treating a level as an automatic entry signal.
Write down the levels before moving forward in replay. Do not add a level just because you later see price react there. If you would not have marked it using your written rules at the time, leave it out of that trade’s analysis.
Quick checklist:
- Did I mark the weekly levels before checking later candles?
- Did I mark the daily levels using the same rules?
- Can I explain why each level is on the chart?
- Am I waiting for a setup instead of entering because price touched a line?
Define the 4H structure and liquidity grab
On the 4H chart, describe the market structure using observable swing points. A break of structure (BOS) or change of character (CHoCH) should have a definition in your plan. For example, you might require a candle close beyond a swing point you marked in advance. Decide what qualifies before you test; do not switch between a wick and a close to make a past trade fit.
For this exercise, define a liquidity grab as price moving beyond a visible prior high or low, then returning back across that level. Treat it as a condition to observe, not proof that the market must reverse. A move beyond a low could be followed by a reversal, but price could also continue lower.
After the grab, wait for the 4H structure condition in your rules. If your plan requires a close beyond a marked swing point and no such close appears, the setup is not confirmed under that plan. Move on. This is an important part of backtesting: skipped trades count too, because you are testing all the signals your rules produce.
Apply the engulfed and engulfing entry rule
The terms “engulfed” and “engulfing” can mean different things to different traders. Write your own candle definition before the test. One simple practice definition is:
- An engulfed candle is a candle whose real body sits within the real body of the next candle.
- An engulfing candle is the next candle, with a real body that covers the previous candle’s real body.
For this example, consider an entry only when the engulfing candle forms after the liquidity grab and after your required structure confirmation. Decide whether you need the candle to close before considering entry. If it does not meet your definition, record “no trade” rather than adjusting the rule to include it.
Also define where the entry would be placed. For example, you might record an entry only after the engulfing candle closes, then put the stop beyond the swing point that would invalidate the setup. That is a practice rule, not a recommendation. A different entry or stop method is a different setup and should be tracked separately.
Record each replay trade in a journal
A useful journal captures what you knew at the time, not only whether the trade won or lost. Save a screenshot before entry if your chart tool allows it, and another after the outcome is visible. Add a short note explaining which rules were met.
For each possible trade, record:
- Date and market.
- Weekly and daily levels that were marked in advance.
- The 4H liquidity-grab and structure conditions.
- Your entry, stop and target under the written plan.
- The result, including the reason for the exit.
- Whether you followed every rule.
- A note about unclear conditions or missed signals.
You can track results in your preferred unit, such as points or planned risk units, as long as you use the same method throughout. Include realistic trading costs when you can estimate them. A historical chart cannot show exactly how a live order would have been filled, and a backtest cannot capture how you will feel when money is at risk.
Review the test without changing the rules mid-way
When you finish a section of chart history, review the whole set of trades. Look for patterns: Were your rules clear enough to apply? Did the setup appear only in certain conditions? Were losses linked to a particular kind of entry, or did you simply have a run of losses? Avoid judging the method from one striking example.
If you spot a possible improvement, write it down as a new version of the setup. Then test that version separately on historical data you have not already used to keep adjusting the rules. Repeatedly tweaking a setup until the old chart looks perfect can make it fit that history too closely. Testing fresh data can help you see whether your written rules remain usable beyond the examples that inspired them.
Backtesting shows how rules would have applied to a selected period of past data. It does not tell you what will happen next. Results can also differ from live trading because execution, costs and market conditions may not match the assumptions in your test.
A practice plan you can start today
Choose a chart period, open XAUUSD and hide the candles to the right of your starting point using replay. Mark weekly and daily levels first. Advance one candle at a time, applying the same 4H conditions throughout. Record every qualifying setup and every missed setup. When the test is complete, review your notes before deciding whether any rule needs to be clearer.
You do not need to rush through the chart. The goal is to practise following a written process and learn what you can from the examples you record. You can practise free on Apex Charts or join a course to keep building your skills.
FAQ
How do I backtest a forex strategy manually?
Write specific entry and exit rules, then use chart replay to move through historical candles in order. Record every signal that meets your rules, including losses and trades you chose not to take.
Is backtesting enough before trading live?
No. A backtest uses past price data and cannot guarantee future results or reproduce every live trading condition. It can help you review your rules; practise them further before deciding whether they suit you.
What should I write in a trading journal during a backtest?
Record the market, date, setup conditions, entry, stop, target, result and whether you followed your rules. A screenshot and a short explanation can help you review the decision later.
Education only - not financial advice. Trading carries risk; never risk money you cannot afford to lose.
Want to see this on live charts?
Inside the course we apply every lesson to real Weekly, Daily and 4H charts - with mentorship until it clicks.
Education only, not financial advice. Trading on margin carries a high level of risk. Always use a stop loss and risk only what you can afford to lose.
Next lessonForex Trading Routine: Build a Calm, Repeatable Process →
A forex trading routine can help you prepare, follow your rules and review decisions. Build a simple daily process that fits your life and schedule.