Tidava

Trading Strategy Backtesting: A Step-by-Step Guide

Isometric planes trace a trading test process

Backtesting means running a strategy’s rules against historical data to estimate how it would have performed. Done well, it shows the risk and return profile of an idea before you put capital behind it. Done badly, it produces a flattering curve that disappears in live trading. The difference lies in written rules, honest cost assumptions, clean data and out-of-sample validation. Tidava Pro puts price action, order flow, volatility and macro context in one workspace, so the market conditions behind a result are readable instead of buried in a single equity curve.

Tidava
Read Market Conditions More Clearly
Bring price action, order flow, volatility, and macroeconomic context into one workspace to make market conditions behind trading results easier to read.
Visit

TL;DR

Table of Contents

What a backtest can and cannot tell you

A backtest is a simulation. You take a rule set, apply it to historical prices, and record the trades the rules would have produced. CFA Institute’s 2026 reading on backtesting and simulation describes its main purpose as understanding a strategy’s risk-return trade-off by approximating the real investment process.

That is a narrower claim than “proof it works.” A backtest tells you:

It does not tell you that the future will resemble the sample. Treat the result as a hypothesis that has survived one filter, then add more filters.

Step 1: State the hypothesis and the goal

Start with a sentence in plain words: why should this pattern pay? “Breakouts above a multi-week high continue when volatility is expanding and volume confirms” is testable. “Buy when the indicator looks good” is not.

The CFA Institute’s process begins here: specify the investment hypothesis and goals before anything else. Define the goal in numbers too: target return, the maximum drawdown you can tolerate, and the holding period. Without a goal, any result can be rationalized afterward.

Where it goes wrong: choosing the hypothesis after looking at the data. If you scroll charts until a pattern appears and then “test” it on the same charts, you have described history, not tested an idea.

Step 1: State the hypothesis and the goal

Step 2: Turn the idea into exact rules

The next step in the same framework is to determine the strategy’s rules and processes. Write them so that two people would produce identical trades:

  1. Universe: which instruments (equities, FX, commodities, crypto, indices) and which sessions.
  2. Entry: the exact condition, evaluated at a specific bar close or time.
  3. Exit: profit target, stop, time stop or signal reversal.
  4. Position size: fixed fraction of equity, volatility-scaled, or fixed risk per trade. The free position size calculator helps you set risk per trade before you test.
  5. Filters: volatility, trend or macro conditions under which you do not trade.
  6. Rebalance or review frequency.

Every discretionary phrase (“strong trend,” “clean level”) must become a measurable definition. If you cannot define it, you cannot backtest it.

Step 3: Choose data that matches the rules

The data must be fine enough for your entries and exits. A strategy that depends on intraday fills cannot be judged on daily bars. An order-flow strategy needs order-level or trade-level data, not candles.

Check these points before you trust any dataset:

If you want to test with your own data feed, Tidava offers a Bring your own data plan at 19 USD per month or 190 USD per year, and a managed real-time option for those who want the data handled.

Step 4: Model costs honestly

Gross returns are a fiction. Spreads, commissions, slippage and financing all subtract, and they subtract more the faster you trade.

The BIS working paper on currency momentum strategies (December 2011, covering 1976 to 2010) is a clear example. Applying the full bid-ask spread reduced its best strategy’s return from nearly 10% to about 4% per year. The authors’ point is that transaction costs can be decisive, especially when turnover sits in costly instruments.

A practical cost model:

Step 5: Run the test and compute the metrics

The CFA Institute method is to form the portfolio according to the rules, rebalance periodically, and compute performance and risk profiles. Its evaluation guidance is to interpret a set of performance and risk metrics rather than lean on one return number.

A useful scorecard:

Metric What it answers
Annualized return net of costs Is there an edge after friction?
Maximum drawdown and its duration Could you sit through the worst stretch?
Volatility of returns How bumpy is the path?
Return per unit of risk (for example a Sharpe-type ratio) Is the return worth the risk?
Number of trades Is the sample large enough to mean anything?
Win rate and average win versus average loss Does the payoff structure hold together?
Share of profit from the top few trades Is the result one lucky event?

A 70% win rate with small wins and rare large losses can be worse than a 40% win rate with large winners. Read the pieces together.

Step 6: Hunt for the biases that inflate results

Before you celebrate, check the usual suspects:

A simple defense is to keep parameters few, prefer ranges where results are stable over a single “best” value, and record how many variants you tried.

Step 7: Validate out of sample and walk forward

Split your history. Build and tune the strategy on one part, then test untouched data. Better still, use a rolling approach. The CFA Institute methodology uses a rolling or walk-forward window: calibrate signals on the window, rebalance periodically, and track performance over time so the simulation approximates live decision-making.

In practice:

  1. Fit on years one to three, test on year four.
  2. Roll forward: fit on years two to four, test on year five.
  3. Stitch the test segments into one out-of-sample record.
  4. Compare it with the in-sample result. A large gap signals overfitting.

Then paper trade or trade small. Live results are the final out-of-sample test.

Step 8: Read the result by market regime

A single equity curve hides why a strategy won. Break the trades down by condition: trending versus ranging, high versus low volatility, risk-on versus risk-off macro backdrop, and for energy, inventory and geopolitical regimes. A momentum rule that earned everything in two trending years and bled in the rest is a regime bet, and you should size and filter it as one.

This is where an integrated workspace saves effort. Tidava combines price action, order flow, volatility and macroeconomic context, and focuses on structured, explainable outputs showing who controls the market. When you review a backtest trade by trade, that context lets you label each one by condition and ask whether the setup you tested is present today. Its risk-first workflow and multi-timeframe analysis fit the same habit: define risk before reward.

Step 8: Read the result by market regime

Where Tidava fits in your testing workflow

Tidava is a market analysis platform, not a broker, and it has no trade execution or broker connections. That suits the research stage: you build the structured read of a market, document the framework and risk assessment, and decide with a clear view of conditions.

Tidava Pro costs 24.99 USD per month or 199 USD per year, and a 6-hour free trial lets you see the live workspace. Combined plans with your own data or a managed real-time feed are on the pricing page. For how its models are described and what status they have, see the methodology page.

Tidava

If you want to compare tool types first, the guide to trading analysis software lays out the options.

A worked example

Suppose you test a rule on an index: buy when price closes above its 50-day high and 20-day realized volatility is rising, exit on a close below the 20-day low, risking 1% of equity per trade.

  1. Write it down exactly as above, including the filter.
  2. Use 15 years of daily data covering several regimes, with index data properly adjusted.
  3. Apply a conservative cost per trade and a slippage allowance, then re-run with costs doubled.
  4. Record net return, maximum drawdown, trade count and profit concentration.
  5. Walk forward in rolling windows and compare with the in-sample figures.
  6. Split trades by regime. If nearly all profit came from one crisis year, the rule is conditional, so trade it only when that condition is present.

If the result holds across steps, you have a candidate worth small live capital, not a certainty.

Common questions

How much historical data do I need to backtest a trading strategy?

Enough to cover several market regimes and produce a meaningful number of trades. There is no universal figure, since it depends on holding period and frequency. A rule that trades a few times a year needs far longer history than an intraday one.

Is a profitable backtest enough to trade a strategy live?

No. A backtest approximates the real process, and as the CFA Institute notes, it does not establish that future results will match. Add realistic costs, out-of-sample testing and a small live trial before scaling.

What is the difference between backtesting and walk-forward testing?

A plain backtest runs rules over the whole history. Walk-forward testing calibrates on a rolling window, then tests on the data that follows, repeating the process. It approximates how you would have updated the strategy in real time.

Which metrics matter most?

Look at net return, maximum drawdown, return per unit of risk, trade count and profit concentration together. No single figure tells you whether a strategy is robust.

Sources

Made with BabyLoveGrowth to reach people on Google and AI search