Testing and analysis
Backtest Warm-Up Periods: Prepare Indicators Before Testing
Published ForeXpert team日本語で読む

Backtest warm-up periods supply historical observations for indicator calculations before the period you evaluate. Keep that preparation separate from the trades you score. When checking whether more history changes an indicator, compare its values and your decisions at the same evaluation start time.
A visible indicator line does not, by itself, establish that the preparation is sufficient. You also need to know the indicator type, its settings, the chart timeframe and the price input. This guide explains those checks with a small moving-average example and a practical workflow for manual chart replay. It does not prescribe a trading setup or a universal number of warm-up bars.
What backtest warm-up periods prepare
Indicators use observations from earlier bars. If you open a test at the first moment you want to evaluate, the tool may also need earlier prices to calculate the values your rules require. The relevant distinction is between the history used for calculation and the interval used to assess decisions.
In this guide, the preparation interval supplies that history without placing orders. The evaluation interval begins at a predetermined timestamp, with no open position. Keeping the starting position state consistent avoids a second source of differences: trades carried across the boundary.
Some automated platforms make this distinction explicit. QuantConnect's warm-up documentation describes processing earlier data before the algorithm starts, with trading disabled during warm-up. That is one implementation of the separation. It does not establish that every charting app offers the same controls or restrictions.
| Part of the test | Purpose | What to record |
|---|---|---|
| Preparation interval | Supply earlier observations for calculations | History start and available bar count |
| Evaluation interval | Compare decisions under fixed rules | Start, end and decision log |
| Indicator specification | Keep the calculation consistent | Type, period, timeframe and price input |
Earlier data must still be earlier than the decision being made. Extending the history to the left is different from allowing future candles into a calculation. Our guide to look-ahead bias explains the latter problem. Both checks matter, but solving one does not solve the other.
How many bars do indicators need?
Check the calculation window for an SMA
A five-period simple moving average, or SMA, based on closing prices takes the sum of the latest five completed closes and divides it by five. Consider these fictional prices, ordered from oldest to newest: 100, 102, 101, 103 and 104. They are an arithmetic illustration, not observations from a currency pair.
Five-period SMA = (100 + 102 + 101 + 103 + 104) ÷ 5 = 102
With only four closes, that definition of a five-period SMA cannot be evaluated. Substituting the average of the four available values changes the calculation. The official Stock Indicators SMA documentation specifies N observations for an N-period SMA and returns no value for the first N−1 observations.
However, a rule can require more than the current value. If you compare today's SMA with the preceding SMA, you also need enough history for that preceding calculation. A crossover rule similarly requires the previous relationship between two lines, as well as their current relationship. Write down each value your actual rule references before deciding that the longest indicator period is sufficient.
Separate EMA availability from initialization effects
An exponential moving average, or EMA, carries previous calculated values forward. Its initialization and available history can therefore leave differences at a later timestamp. Seeing a number means a value has been produced; it does not prove that using a longer history would produce a sufficiently similar value for your decision.
The official Stock Indicators EMA documentation warns about convergence-related precision in the initial part of its output. That warning is a reason to inspect initialization, not a universal bar-count rule. Its specific recommendations belong to that implementation and should not be transferred automatically to another library or to ForeXpert.
The timeframe also matters. Twenty hourly observations and twenty daily observations cover different spans of time. Market closures and missing observations mean a calendar difference alone does not establish how many usable bars exist. If bars themselves appear absent, first follow the separate missing-candle checks. An initialization check cannot repair a gap in the underlying series.
A four-step check with a fixed evaluation start

1. Fix the evaluation interval first
Record the currency pair, decision timeframe, evaluation start and end, and whether decisions use completed bars. Also record that the test begins without an open position. If your rules use a higher-timeframe indicator, check its history separately. A large number of lower-timeframe candles does not establish that the higher-timeframe calculation is ready.
Do this before inspecting the results. If preparation turns out to be insufficient, avoid quietly moving the evaluation start to a more convenient point. A revised evaluation interval can be useful, but label it as a different test and explain why the scope changed.
2. Inspect the indicator and its inputs
Record more than a shorthand such as “20 MA.” Specify whether it is an SMA or EMA, its period, the input price and the timeframe. Check whether the current bar is complete. Two charts can display similarly named lines while calculating from different observations.
Note missing values or lines, as well as unusually different values near the beginning of the history. These are observations to investigate, not automatic evidence that a trading rule is defective. If the platform does not expose a calculation detail, record the uncertainty rather than filling in an assumption.
3. Extend earlier history and compare the same timestamp
Where the tool allows it, load more history before the unchanged evaluation start. Then compare the indicator values and rule decisions at the same completed timestamps. Keep the data source, settings and evaluation end unchanged too. Otherwise, several possible explanations are being tested together.
A difference in trade count needs particular care. Did you accidentally evaluate more time, or did an indicator change a decision inside the same interval? Those are different findings. Check the decision log before interpreting the aggregate results.
Small numerical differences can still change a decision close to a threshold. Compare whether the predetermined condition is satisfied, rather than judging only whether two rounded numbers look similar. When comparing different tools, also investigate price inputs and timestamps; warm-up is only one possible explanation for a disagreement.
4. Record limitations when comparison is unavailable
Some tools do not let you control how much earlier history they load. In that case, write “loaded history length not verified.” Do not describe an adjustment you could not actually make. You can investigate the documentation or create a separately labelled test with a later start, while acknowledging that the evaluation scope has changed.
| Notebook field | Illustrative entry |
|---|---|
| Indicator | Five-period SMA of closes |
| Decision timing | After each candle completes |
| Initial position | None at evaluation start |
| History check | Compare longer history at the same start timestamp |
| Unresolved detail | Number of earlier bars loaded by the tool |
This is a reproducibility note, not a performance report. An unresolved field is useful information: it tells you which assumption to investigate if another run behaves differently. Keep it with the rule version and the dates rather than relying on memory.
Applying the checks during ForeXpert practice
ForeXpert lets you step through historical charts one candle at a time and display indicators such as moving averages and RSI. You can also view multiple timeframes together. Choose the indicators and timeframes for a practice session, and record your reasoning in an external notebook before advancing the chart.

The screenshot illustrates the interface. It is not a recommended indicator configuration or proof that a particular history requirement has been met. This guide does not claim that ForeXpert includes a dedicated warm-up bar setting or an automatic readiness check. Use the information you can inspect and record anything you cannot verify.
Keep this exercise manageable by checking one assumption at a time. Changing the rule, history and evaluation window simultaneously makes differences difficult to explain. Our manual backtesting workflow provides the wider sequence for defining a test, replaying candles and reviewing the record.
Warm-up checks improve the clarity of a historical test's assumptions. They do not establish that a rule will succeed in live trading. Backtest results do not guarantee future performance, and actual trading involves the risk of loss.
FAQ
Is there one warm-up bar count that works for every indicator?
No. The calculation, implementation and values referenced by the rule all matter. Start with the tool's documentation, then compare longer history at the same timestamp where possible. Do not treat the indicator's period setting alone as proof of sufficient preparation.
Should trades during preparation count toward the results?
In the workflow here, no orders are placed during preparation and evaluation starts at a fixed time. Decide that boundary before looking at results. Adding selected preparation trades afterward would make the comparison inconsistent.
If a line is visible, can I skip the check?
Visibility is not sufficient by itself. A calculation can produce a value while initialization still affects it. Check the input price, completed-bar timing and available history as well, and document unresolved details.
Summary
Separate the historical observations used to prepare indicators from the interval used to evaluate decisions. Specify the indicator type, period, timeframe and inputs. Where possible, extend only the earlier history and compare values and decisions at the same evaluation start time.
For your next practice session, begin with a short note containing the indicator settings and evaluation boundary. If you cannot verify the loaded history, say so. A clear limitation is more useful than assuming that two tests had identical starting conditions.


