Trading forex and CFDs on leverage is high risk. Most retail accounts lose money. Read the risk warning

How to Backtest Manually on TradingView

To backtest manually on TradingView, write your strategy rules down first, open a chart of your chosen pair and timeframe, start Bar Replay from a date well in the past, and step forward one candle at a time, placing each trade with the Long or Short Position tool exactly as your rules dictate. Record every trade in a spreadsheet, keep going until you have a meaningful sample (100 trades is a reasonable minimum), then calculate win rate, average R and expectancy. The whole value of the exercise depends on not peeking at the future and not bending the rules.

Key takeaways

  • Manual backtesting tests a written rule set, so write the rules before you open the chart.
  • Bar Replay hides future candles; use it, because scrolling a finished chart creates hindsight bias.
  • Log results in R multiples, not money, so outcomes are comparable across different stop sizes.
  • Aim for at least 100 trades across varied market conditions before drawing any conclusion.
  • Subtract realistic spread and slippage; a strategy that only works at zero cost does not work.
  • A good backtest is evidence, not proof. Forward test on demo before risking real money.

What manual backtesting is and why it is worth doing

Backtesting means applying a fixed set of trading rules to historical price data to see how they would have performed. Automated backtesting does this with code; manual backtesting does it with your eyes and hands, candle by candle. Manual testing is slower, but it has two advantages for discretionary traders. First, it works for strategies that are hard to code, such as price action setups, supply and demand zones or market structure shifts. Second, it trains your pattern recognition: after 300 replayed trades, you will recognise your setup in live markets far faster.

The limitation is that you are the execution engine, and you are biased. Everything in this guide is designed to reduce that bias. If your strategy is fully mechanical, an automated test will be faster and more objective; see our overview of the best forex backtesting software for alternatives.

Step 1: Write the rules before you touch the chart

A backtest of vague rules produces a vague result. Before replaying a single bar, write down answers to these questions in a document you will not edit during the test:

  • Market and timeframe: for example EUR/USD, 1-hour chart, with the 4-hour chart for trend direction.
  • Session filter: for example only trades triggered between 07:00 and 16:00 London time.
  • Entry trigger: the exact condition, such as "a bullish engulfing candle closing above the 20 EMA after price has touched the 50 EMA in an uptrend defined by higher highs on the 4-hour".
  • Stop loss: where it goes, for example 2 pips below the low of the signal candle, or 1.5 × ATR(14).
  • Take profit and management: fixed 2R target, partial at 1R, trailing stop, or exit on an opposite signal.
  • Filters and exclusions: skip trades within 30 minutes of high-impact news, skip Friday afternoon, skip if spread would be abnormal.
  • Risk unit: every trade risks 1R. Money comes later.

If you find yourself writing "if it looks strong", you have found a rule that needs tightening. Discretion is allowed, but it must be described well enough that you would make the same call on the same chart twice. Our guide to building a forex trading plan has a fuller template.

Step 2: Set up TradingView for replay

Chart preparation

  1. Open a new chart layout dedicated to backtesting so you do not clutter your live layout.
  2. Load the symbol. Use a broker or data feed that resembles where you will actually trade, because candle highs and lows differ slightly between feeds.
  3. Add only the indicators your rules use. Extra indicators invite extra discretion.
  4. Set the chart timezone (bottom right of the chart) to the timezone your session rules use, so your session filter is applied correctly.

Starting Bar Replay

  1. Click the Replay button in the top toolbar.
  2. Choose a start point by clicking on the chart, or use the "select date" option. Pick a date that gives you a long run of data ahead, for example two to three years back.
  3. The chart now hides everything to the right of the start point. Use the forward step button (or the keyboard shortcut, typically Shift + right arrow) to reveal one candle at a time.
  4. Avoid the auto-play mode while you are learning; stepping manually forces you to make a decision at each close.

Plan availability changes, so check the current position on TradingView's own site: at the time of writing, replay on intraday timeframes and some features such as multi-timeframe replay depend on a paid plan, while the free plan is more limited. Also note that on lower timeframes the amount of historical intraday data available in replay depends on your plan.

Step 3: Take trades with the position tools

When your entry condition appears on a closed candle, place the trade using the Long Position or Short Position tool from the left toolbar (under the forecasting and measurement tools).

  1. Click at the entry price (normally the open of the next candle, because you only know the signal after the close).
  2. Drag the red zone to your stop price and the green zone to your target.
  3. Open the tool's settings to enter account size and risk; the tool shows the position size and the risk-reward ratio, which is useful practice for position size calculation.
  4. Step forward until either the stop or the target is hit. The tool will shade the result.

Handling the awkward cases

  • Stop and target both inside one candle: you cannot know which came first on that timeframe. Either drop to a lower timeframe to check, or adopt a conservative rule that it counts as a loss. Write the rule down and apply it consistently.
  • Gaps over the weekend: if price opens beyond your stop, record the loss at the open price, not your stop price. That is what would have happened.
  • Management rules: if you trail stops, move them only at candle closes, as you would live.

Step 4: Log every trade properly

TradingView is the testing ground, but the results belong in a spreadsheet or journal. A screenshot per trade is useful; the numbers are essential. A minimal log looks like this:

#Date/timePairDirectionEntryStop (pips)ExitResult (R)Rules followed?Note
12024-03-04 09:00EUR/USDLong1.084218Target+2.0YesClean pullback
22024-03-05 13:00EUR/USDLong1.086122Stop-1.0YesNews spike 30 min later
32024-03-07 10:00EUR/USDShort1.091515Stop-1.0YesCounter-trend on H4
42024-03-11 08:00EUR/USDLong1.093020Partial + BE+0.5YesPartial at 1R

These rows are illustrative placeholders to show the format, not real test results. Record results in R (profit or loss divided by initial risk) so a 15-pip stop trade and a 40-pip stop trade are comparable. A free template is a good starting point; see our Excel forex trading journal template.

Account for costs

Replay fills are perfect; live fills are not. Deduct an estimate of spread and commission from each trade. If your average stop is 20 pips and your all-in cost is about 1 pip, each trade loses roughly 0.05R to costs. On a strategy averaging 0.15R per trade before costs, that is a third of the edge gone. For scalping strategies with tiny stops, costs can wipe out the edge entirely.

Step 5: How many trades is enough?

Small samples lie. With 20 trades, a coin-flip strategy can easily show a 65% win rate. A practical framework:

Sample sizeWhat you can reasonably conclude
Under 30 tradesAlmost nothing; you are learning the setup, not measuring it
30 to 100 tradesRough indication of whether the idea is clearly broken
100 to 200 tradesA reasonable first estimate of win rate and average R, still with wide error
200+ trades across different regimesA more trustworthy picture, especially if results hold in trending and ranging periods

To see why, consider the standard error of a win rate: roughly the square root of p × (1 − p) ÷ n. At a 50% win rate and 100 trades, that is √(0.25 ÷ 100) = 0.05, so a measured 50% could plausibly reflect anything from about 40% to 60%. At 400 trades the error halves to 2.5%. Spread your sample across years, not just the last three months, and include at least one choppy period.

Step 6: Analyse the results

Once you have your sample, calculate:

  • Win rate: wins ÷ total trades.
  • Average win and average loss in R.
  • Expectancy: (win rate × average win) − (loss rate × average loss). Our guide to the expectancy formula covers this in depth.
  • Maximum drawdown in R and the longest losing streak.
  • Results by subgroup: by session, by day of week, by long versus short. Be careful here; slicing small samples finds patterns that are pure noise.

Worked example: 120 trades, 48 wins averaging +1.9R, 72 losses averaging −1.0R. Win rate is 40%. Expectancy = 0.40 × 1.9 − 0.60 × 1.0 = 0.76 − 0.60 = +0.16R per trade before costs. After 0.05R of costs, +0.11R. Over 120 trades that is about +13R. At 1% risk per trade, that is roughly a 13% gain over the sample period before compounding, which is meaningful but leaves little room for execution errors. The longest losing streak in a sample like this could plausibly be eight to ten trades; check that you could tolerate that emotionally and within any prop-firm drawdown limits.

A backtest is not a forecast. Manual tests are prone to hindsight bias, subtle rule changes mid-test and unrealistically perfect fills. Market conditions also change. Treat a positive result as a reason to forward test on demo or with very small size, not as evidence that the strategy will make money. Leveraged forex trading carries a high risk of loss, and most retail accounts lose money.

The biases that ruin manual backtests

  • Peeking: scrolling right "just to see" contaminates every later decision. If you peek, restart from a new date.
  • Rule drift: after 40 trades you "improve" the entry. That is fine, but it starts a new test; do not blend the results.
  • Selective skipping: passing on setups that "looked weak" is often unconscious hindsight. Take every valid signal.
  • Cherry-picked periods: testing only trending months makes trend strategies look brilliant.
  • Over-optimisation: tuning a moving-average length until results peak fits the past, not the future. The same issue affects automated systems; see our piece on curve fitting.

A useful safeguard is out-of-sample testing: develop the rules on one period, then test unchanged on a different period you have not looked at. If the edge vanishes, it probably was never there.

After the backtest: forward testing

Run the same rules on a demo account or tiny live size for at least a few weeks, logging in the same format. Compare: is the win rate within the range the backtest suggested? Are you taking every signal? Live execution usually reveals hesitation, missed entries and emotional exits that replay never shows. Only when forward results are broadly consistent with the backtest is it reasonable to consider increasing size, and even then, increase gradually.

Frequently asked questions

Can you backtest on TradingView for free?

Bar Replay is available on the free plan with limitations; at the time of writing, intraday replay and some advanced replay features require a paid subscription. Plan features change, so check TradingView's pricing page. You can still do a basic manual test on higher timeframes for free, or practise intraday setups by covering the right side of a chart, though that is less reliable.

How long does a manual backtest take?

It depends on the timeframe and how often your setup appears. A daily-chart strategy might give 100 trades across several pairs in a few sessions of work, while a 15-minute strategy could need many hours. Budget time for logging and screenshots too. Splitting the work into sessions of an hour or two helps you stay focused and consistent.

Is manual backtesting accurate?

It is less precise than automated testing because you make the execution decisions, fills are idealised and intrabar order is uncertain. It is still useful for testing discretionary setups and building skill. Improve accuracy by writing strict rules, never peeking ahead, deducting costs and using conservative assumptions when a candle hits both stop and target.

Should I backtest on multiple currency pairs?

Testing on several pairs helps you reach a larger sample faster and shows whether the edge is general or specific to one market. Keep pairs with similar behaviour together, or analyse them separately, because a strategy suited to EUR/USD may behave differently on a volatile cross such as GBP/JPY.

What is a good win rate in a backtest?

Win rate on its own means little. A 35% win rate can be profitable with an average win of 2.5R, while a 70% win rate can lose money if losses are much larger than wins. Focus on expectancy after costs, drawdown and the longest losing streak, and make sure the sample is large enough to trust.

Can I use Pine Script instead of manual replay?

Yes, if your rules can be expressed precisely in code, a Pine Script strategy gives faster and more objective results across far more data. Many traders combine both: replay to refine a discretionary idea and train recognition, then code a simplified version to test across longer history. Watch for repainting indicators that use future data.

This article is general information, not personal financial advice. Figures such as spreads, fees, leverage and rules change; confirm them with the provider and check the provider is authorised for your country of residence.