Forex BasicsAugust 7, 2026 · 8 min read

How to Backtest a Forex Strategy Step-by-Step (2026)

A practical beginner guide to manually backtesting a forex strategy using TradingView chart replay, a spreadsheet, and realistic trade simulation to measure expectancy, edge and drawdown.

Backtesting lets you learn whether a trading idea has any real edge before you risk money. This guide shows complete beginners how to backtest a forex strategy manually using TradingView's chart replay, a simple spreadsheet and realistic trade simulation. Follow the steps, use the worked examples, and you'll know how to calculate expectancy, edge and drawdown for your rules-based strategy.

Overview: what manual backtesting answers

What you'll need

  • A free TradingView account (chart replay feature). Use the replay to move price bar-by-bar as if live.
  • A demo account to validate live execution — open a free demo with our partner broker Exness: open a free Exness demo account (demo only).
  • A spreadsheet (Google Sheets or Excel) to record trades and calculate metrics.
  • A clear, simple rule-set for the strategy (pair, timeframe, entry rule, stop, exit or target, sizing method).

Step 1 — Define a strict, testable trading rule

Write the rules so someone else could follow them exactly. Example:

  • Market: EUR/USD
  • Timeframe: 1-hour chart
  • Entry: Price closes above 20 EMA and a bullish engulfing candle closes above prior 2 bars.
  • Stop: 30 pips below entry.
  • Profit target: 2× stop (60 pips) or a trailing stop after 30 pips in profit.
  • Risk per trade: 1% of account balance.

Keep rules mechanical. If you need help building a watchlist or focusing on the most liquid pairs, see: How to Make a Forex Watchlist in 2026.

Step 2 — Choose sample size and data range

Begin with at least 50–200 trades if possible. The exact number depends on your strategy frequency — low-frequency strategies need longer historical time. For guidance on trade counts, see: How Many Trades to Test a Forex Strategy in 2026.

Step 3 — Prepare your spreadsheet

Create columns that capture every rule and result. Minimal columns:

  • Date
  • Pair
  • Direction (Long/Short)
  • Timeframe
  • Entry price
  • Stop price
  • Target price
  • Position size (lots)
  • Pips won/lost
  • Profit/Loss (USD)
  • Reason / Notes

Include formulas to compute pip distance and P/L automatically. Example formulas (EUR/USD style):

  • pip_distance = ABS(entry - stop) / 0.0001
  • pip_value_per_standard_lot = $10 for USD-quoted pairs
  • profit_loss = pips_won_or_lost × pip_value_per_standard_lot × lot_size

Step 4 — Position sizing and the exact maths

Definitions first:

  • Lot sizes: standard = 100,000 units; mini = 10,000; micro = 1,000. Many brokers let you trade decimals, e.g. 0.01 = 1,000 units.
  • Pip: smallest normal price move: 0.0001 for most pairs (0.01 for JPY pairs).
  • Pip value (USD-quoted pair, standard lot) = $10 per pip.

Position sizing formula (standard lots):

lot_size = risk_amount / (stop_pips × pip_value_per_standard_lot)

Worked example — realistic beginner account:

  • Account balance: $1,000
  • Risk per trade: 1% = $10
  • Pair: EUR/USD (USD-quoted), stop = 30 pips
  • Pip value per standard lot = $10

lot_size = 10 / (30 × 10) = 10 / 300 = 0.0333 standard lots (≈3,330 units). Many brokers let you select 0.03 lots. If you round down to 0.03 lots, actual risk = 30 pips × ($10 × 0.03) = 30 × $0.30 = $9 (0.9% of $1,000). Rounding down protects you — always check the actual $ risk after selecting lot size.

For volatility-based sizing (ATR), see our guide: Volatility Position Sizing Forex: ATR Method Step-by-Step 2026.

Step 5 — Use TradingView chart replay to simulate trades

Open the pair and timeframe, press the chart replay button (keyboard shortcut R). Move bar-by-bar or speed up the replay. For each signal that meets your rules:

  • Mark the entry, stop and target on the chart.
  • Record trade details in your spreadsheet exactly at the bar when your signal triggered.
  • Let the replay run until the trade either hits stop or target. If your rules allow partial exits or trailing stops, follow them exactly.

Simulate realistic execution: account for spreads (the difference between ask and bid) and slippage. Record the price you could reasonably have executed at, not the idealized mid-price. If you aren't sure about execution types, read: Market Order vs Limit Order Forex: Beginner Guide 2026.

Step 6 — Calculate core metrics

After you log a decent sample (50+ trades), compute these metrics in your sheet.

  • Total trades = N
  • Wins = number of profitable trades
  • Losses = number of losing trades
  • Win rate = Wins / N
  • Average win (USD) = SUM(profits where profit>0) / Wins
  • Average loss (USD) = ABS(SUM(losses where loss<0) / Losses)
  • Expectancy per trade = (Win rate × Avg win) − (Loss rate × Avg loss)

Example (rounded, realistic):

SampleValue
Trades100
Win rate48%
Average win$12
Average loss$9

Expectancy = 0.48×12 − 0.52×9 = 5.76 − 4.68 = $1.08 per trade. Over 100 trades that's $108, before commissions and swaps.

Expectancy tells you the average money you make (or lose) per trade using your rules and sizing. Multiply expectancy by your expected number of trades per month to estimate realistic progress, but never assume consistent future performance.

Step 7 — Measure drawdown and equity curve

Drawdown: the percent decline from a prior equity peak to a trough. Track an equity column in your spreadsheet that applies each trade's P/L to running equity. Calculate max drawdown as the largest peak-to-trough fall.

Example: starting $1,000, a sequence of losses reduces equity to $850 from a peak of $1,100. Drawdown = (1,100 − 850) / 1,100 = 22.7%.

Why it matters: drawdown affects psychology, position-sizing limits, and whether you can afford to stay in a strategy. If your test shows frequent deep drawdowns, reduce risk per trade or adjust rules.

Step 8 — Validate and avoid overfitting

Split your data: test on an in-sample period, then validate on out-of-sample (data you didn't use to tune rules). If results fall apart out-of-sample, you may have overfitted to past noise. Read more: Forex Strategy Overfitting: How to Spot & Avoid It.

Also test across multiple pairs and market regimes (trending, range, high volatility) to check robustness. Use a watchlist approach to find the best candidate pairs: How to Make a Forex Watchlist in 2026.

Step 9 — Move from demo to live testing only when ready

After you see consistent positive expectancy and acceptable drawdown on demo, forward-test with small real capital if you choose. Practice execution, time-of-day behavior and broker specifics on the demo first — many of our students open the demo with Exness to practice: open a free Exness demo account.

Common pitfalls and how to avoid them

  • Cherry-picking results: stick to one pre-defined dataset and rules before testing.
  • Ignoring spreads and slippage: include realistic execution costs.
  • Small sample size: be patient — low-frequency strategies need months or years of replay.
  • Changing rules mid-test: if you tweak rules, start a fresh test or mark it as a new experiment.

Where to learn the full process (structured course path)

If you want step-by-step coursework with worked examples, quizzes and a structured learning path from beginner to professional, visit the Forex Fluency course catalog at https://forexfluency.com/courses. Our paid modules are ranked by difficulty so you progress logically; beginners typically start with the foundations and then apply the backtesting process inside practical strategy courses.

Quick checklist to start backtesting today

  1. Write exact rules (entry, stop, exit, sizing).
  2. Open a TradingView chart and enable Chart Replay (R).
  3. Create a spreadsheet with columns listed above and formulas for pip value and P/L.
  4. Run 50–200 trades, recording realistic execution (include spread/slippage).
  5. Calculate win rate, avg win/loss, expectancy and max drawdown.
  6. Validate out-of-sample and across pairs; avoid overfitting.

Next steps

If this guide helped you, take the next step with a structured course that teaches position sizing, trade management and realistic testing routines. Browse course options here: https://forexfluency.com/courses. The Forex Fluency blog also has free lessons that support the backtesting process, including order types, risk rules and volatility sizing methods.

Trading forex on margin carries a high level of risk and may not be suitable for all investors. Never trade with funds you cannot afford to lose.

Frequently Asked Questions

How many trades do I need to backtest a forex strategy?

Aim for at least 50–200 trades. The exact number depends on the strategy frequency — intraday systems generate many trades faster than weekly systems. See our guide: https://forexfluency.com/blog/how-many-trades-to-test-a-forex-strategy-in-2026 for more detail.

What is expectancy and why is it important?

Expectancy is the average profit or loss per trade using your rules and sizing. Formula: (Win rate × Average win) − (Loss rate × Average loss). It tells you whether your system is profitable over time.

Can I trust backtest results from TradingView replay?

TradingView replay simulates historical price action bar-by-bar, which is excellent for manual backtesting. Always include spread and realistic slippage, and validate results on a demo account to ensure execution is similar to live trading.

How do I handle spreads and slippage in manual tests?

Include the spread when calculating entry and exit prices (use ask for buys, bid for sells) and assume some slippage if the market is fast or thin. Record the executed price you could reasonably have taken, not an ideal mid-price.

Should I use fixed risk per trade or volatility-based sizing?

Both work. Fixed risk (e.g. 1% per trade) is simple. Volatility-based sizing (using ATR) adjusts lot size to market volatility and can stabilize drawdown. See our ATR sizing guide: https://forexfluency.com/blog/volatility-position-sizing-forex-atr-method-step-by-step-2026.

How do I avoid overfitting when backtesting?

Split data into in-sample (for developing rules) and out-of-sample (for validation). Test across multiple pairs and market conditions. Read: https://forexfluency.com/blog/forex-strategy-overfitting-how-to-spot-avoid-it-2026 for practical techniques.

Can I automate this backtest later?

Yes. Manual backtesting helps you learn the rules and edge. If the strategy proves robust, you can code it or use a platform that supports automated backtests. But always validate automated results against manual tests.

Where should a beginner learn backtesting and position sizing?

A structured course is the fastest way to learn properly. Our courses at https://forexfluency.com/courses guide beginners from foundations to professional techniques with worked examples and quizzes.

Risk warning: Forex trading is high-risk. This is education, not financial advice — never trade with funds you cannot afford to lose.