IS and OOS: where development ends and evaluation begins
Follow a fictional investigation to understand IS and OOS, detect information leakage and separate strategy development, selection and evaluation.

You open the period you had set aside. The strategy loses money during particular trading hours; you add a filter and the curve improves. You have changed just one condition. Yet you now need to answer a different question: are you checking the original version, or developing a new one using what you have just observed?
The historical data have not changed; the version you are evaluating has. That small turn will guide this article. We will follow a fictional investigation from its first rules to a reserved evaluation, then examine what happens when a decision crosses that boundary.
In sample and out of sample, abbreviated IS and OOS, describe the relationship between data and a fitting process. In practice, you also choose candidates, compare metrics and decide what deserves another test. A sample’s role depends on how you use it. A vertical line on a chart does not record those decisions by itself.
By the end of this article, you will be able to:
- Separate three tasks: developing a strategy, selecting a version and evaluating what was fixed.
- Reconstruct a decision: identify which inputs could have been known and which observations still lay in the future.
- Prepare a reviewable test: preserve versions, costs and criteria before opening the reserved block.
The calendars, quantities and situations that follow are hypothetical teaching examples. They do not represent Atlas trades, research or results. The aim is to review a backtest precisely: understand what it can establish, which questions remain open and which check would make sense to prepare next.
The three functions of data
IS usually identifies the sample used to develop or fit a system. OOS refers to observations outside that particular fitting process. The first useful question is what “fitting” means in your investigation. For a machine learning model, it may include estimating coefficients or weights. For a rule-based strategy, it may mean choosing trading hours, indicators, calculation windows or exit conditions.
Another function then appears: selection. You might train ten models on the same data and compare them on a different block. Although that second block did not participate in training the weights, it did influence which model you retained. It is therefore helpful to distinguish development, selection and final evaluation, even if your software groups some of those tasks under one label.
The scikit-learn cross-validation documentation explains why fitting and selection should be separated from evaluation on reserved data. If you use test results to improve the model, that set also contributes information to the decision process. Setting some rows aside does not preserve their independence if you subsequently consult them to make a choice.
Imagine three folders named “development”, “selection” and “evaluation”. Their names help you organise the work, but they do not prevent you from opening them too early. The relevant independence comes from the procedure and its record. If a decision about the final version depended on a result, that result belongs to the development history, even if it sits in a folder labelled OOS.
This does not make selection useless. Comparing alternatives is a necessary activity in many investigations. The problem arises when you describe the result used to choose as though it were an additional check that did not influence the choice. A clear account preserves both pieces of work and gives each the meaning it deserves.
A complete investigation on a calendar
Let us build an example that will continue throughout the article. You have a historical dataset for a fictional instrument covering 2020 through 2025. You want to study a rule that makes decisions when certain bars end and can keep a position open for several subsequent bars. We are not claiming that the rule has an edge: that is precisely the question you want to investigate.
Before calculating results, you propose three blocks. The years 2020 through 2022 will be used for development. The year 2023 will be used to compare variants. The period from 2024 through 2025 will remain reserved for a later evaluation of the chosen version. These dates are illustrative; their allocation is not a recipe suitable for every market, frequency or number of trades.
| Hypothetical period | Intended role | Permitted decisions |
|---|---|---|
| 2020–2022 | Development | Create rules, debug code and propose variants |
| 2023 | Selection | Apply a fixed criterion to choose between variants |
| 2024–2025 | Reserved evaluation | Measure the chosen version without changing it in response to the result |
The table clarifies your intentions, but it needs a more precise specification. You write down which information the rule may use, when it becomes available and how entries and exits are simulated. You also define a simple reference against which to compare the system. That reference might examine an elementary exposure rule or a constant prediction, depending on the question, always with an explicit interpretation.
During development, you discover implementation errors and correct them. You check small examples manually to verify that a signal cannot appear before its inputs exist. You adjust the handling of positions still open at the end of a session. All these decisions belong to development, even if some appear purely technical. They can change the trades and therefore the result.
By the time selection begins, you have defined twelve variants. That number is invented for this exercise. You record all twelve, including the ones that seem unpromising, and specify how you will compare them in 2023. For example, you might require that the result remains interpretable after costs and choose according to a predefined metric, keeping other indicators as context. This criterion remains a research proposal, not a guarantee of quality.
The criterion should address awkward cases. What happens if no variant qualifies? How do you choose between two very similar results? Is there a minimum number of observations? Are you allowed to refrain from choosing? If you answer after seeing which variant wins, your answers can adapt to the outcome. Writing them beforehand makes it easier to recognise whether the procedure was respected.
Suppose the criterion selects variant C. You save its code, configuration, development data, selection decisions and simulator version. From that point, the reserved evaluation will examine that specific version or the entire selection procedure, depending on what you defined. Saving the family name is insufficient: two configurations from the same family can behave differently.
You then open 2024–2025 and calculate the trades without readjusting variant C. You preserve both the summary and the detailed signals, positions, costs and valuations. The evaluation may be favourable, unfavourable or too limited to answer the question. All three possibilities belong in useful research. Reserving data is not intended to ensure that the final chart is positive.
What changes when you look again
Continue with the same story. Variant C loses money during part of 2024. While reviewing the trades, you notice that a trading-hours condition would have removed several losses. You add that condition and run the historical simulation again. The chart improves. You have discovered an idea worth examining, but you have also changed the relationship between the strategy and the period that was reserved.
The new variant, C2, uses information obtained by observing 2024. Its result for that year therefore cannot be described in the same way as C’s original result. The modification is legitimate exploratory work if it is identified. Silently replacing C with C2 while keeping the same independent-evaluation label would be inaccurate.
The change can be subtler. Perhaps you do not alter the rules and simply choose another of the twelve candidates after seeing their 2024 results. Or you decide to present only the instruments that finished positive. Or you change the main metric because the system stands out on another one. In each case, information from the reserved block influences a subsequent decision.
An informal observation can influence the process too. Looking at an equity curve, remarking that a particular month seems problematic or remembering which markets performed well can direct the next search. You will not always be able to measure exactly how much that knowledge mattered. You can record that it existed and avoid presenting the dataset as entirely unknown to the person who designed the system.
A reasonable response is to preserve versions with clear names. C keeps its evaluation exactly as obtained. C2 is documented as a revision prompted by that result. The next check should consider which data have not yet participated in its decisions and what question those data can answer. If no appropriate data remain, you can prepare subsequent monitoring without pretending that a new independent historical sample exists.
Moving the boundary retrospectively to improve the report’s appearance does not solve the problem either. If, after knowing the entire period, you choose a start date that makes the result favourable, that date is another data-driven decision. Investigating a change in behaviour may be worthwhile, but the research should explain how it was identified and which separate evaluation could check it.
The record has practical value. Several months later, you will be able to distinguish an idea that failed a test fixed beforehand from one that has not yet had that opportunity. Both can remain in your archive. What changes is the confidence they justify and which next task deserves your time.
Dates are not enough: when did you know each input?
Sorting rows chronologically is a good start for an evaluation intended to inform future decisions. You still need to check what each date represents. A bar might be labelled by its opening or closing time. An indicator might assign its result to an instant earlier than the last input it uses. A file might incorporate corrections published after the date shown in its first column.
Build a small availability table for important features. Include the event time, the moment when the information could have been known and the decision time that consumes it. In the fictional example, if a rule decides when a bar finishes, explain whether it uses that bar’s closing price and when the first possible execution after calculating the signal would occur.
One useful check is to choose five decisions and reconstruct them manually. Do not choose only winning trades. Include an entry, a decision not to enter, an exit and a case near a boundary between blocks. For each one, record which observations should have been available. Then compare them with the rows the program actually read.
Learned transformations count too. The scikit-learn common pitfalls documentation shows how normalising or selecting features using test information can introduce leakage. It recommends splitting the sets before learning those transformations and fitting them using only the permitted training data.
In our hypothetical investigation, calculating a mean and standard deviation from all years to standardise the features would allow 2024–2025 to influence the treatment of training data. A version consistent with the design would learn the transformation within the appropriate block and apply its parameters to subsequent observations. If the system recalculates those parameters over time, the frequency and admissible information must also be specified.
Another detail appears in rolling windows. pandas distinguishes windows labelled at their right edge from centred windows. For a centred window, the calculation assigned to a row can include later observations. When building features for historical decisions, inspect the window’s actual boundaries rather than assuming that an indicator’s name guarantees causality.
The operational question is always concrete: could this value have been produced from the data available at that moment? A verifiable answer is more useful than a general statement that the system “does not use the future”.
Overlapping labels and evaluation boundaries
In supervised learning, an observation’s date can differ from the date when its outcome becomes known. Suppose a row is created every five minutes and its label describes the movement over the following fifteen minutes. A row timestamped 11:50 needs information through 12:05 to complete its label.
If you declare that training ends at 12:00 and the next block starts immediately afterwards, that row crosses the boundary. Although its entry timestamp is before 12:00, its outcome uses part of the subsequent period. The same reasoning applies to other rows according to their horizons. It is therefore useful to store the start and end of the interval associated with each label.
This example is deliberately small. You can draw three segments on paper: one label covering 11:40 to 11:55, another covering 11:50 to 12:05 and a third covering 11:55 to 12:10. The first lies entirely before the boundary; the others cross it. Inspecting intervals makes visible a problem that disappears if you look only at the file’s first column.
TimeSeriesSplit lets you introduce a separation parameter between training and testing. Its documentation specifies that this gap is expressed in numbers of samples. It also states that samples should be equally spaced when comparing durations across splits.
The appropriate separation depends on how your observations are constructed. A fixed gap of three rows does not necessarily equal fifteen minutes if there are interruptions or irregular samples. It also does not automatically handle labels whose horizons change with an exit barrier. In those cases, inspect the actual intervals and explain the criterion used to exclude overlapping observations.
Avoid turning the gap into a parameter you optimise until the result improves. Its purpose should be related to shared information or a specific operational condition. If comparing several gaps is part of the investigation, record that comparison as another development decision and preserve its effect on the number of available observations.
Warm-up is not an invisible trade
A strategy may need earlier observations to calculate its first indicator in the evaluation block. A moving average, for example, requires some history. Letting the calculation read prices from before the first evaluated decision can be consistent with actual execution: those prices would already have been known. The important distinction is between warm-up information and counted results.
Define which data initialise the system, when it may start opening positions and when performance measurement begins. If warm-up generates trades that later disappear from the report, check whether their effects persist in the model’s state or account capital. A simulation may appear to start flat while retaining variables calculated from omitted decisions.
In our example, you might decide that each block begins without positions but with indicators initialised using only earlier history. That is one possible convention. Another investigation might carry positions between blocks to represent a continuous process. Both need to explain how gains, losses and costs are allocated when a trade crosses a boundary.
The aim is not to make every study adopt the same convention. It is to let another person reconstruct yours. A difference in the first trade can propagate if the system depends on its previous state, account size or rules that prevent simultaneous positions. An initialisation detail therefore deserves to be written down even if it occupies barely one line on the chart.
Evaluating trades requires an execution description
An OOS evaluation provides information about the system you actually simulate. If you omit costs or use prices unavailable under the described rule, reserving dates does not correct the defect. Temporal separation and realistic execution are different dimensions that need to be examined together.
The QuantConnect slippage documentation defines slippage as the difference between an expected price and the execution price. It identifies factors related to system timing, the connection and market conditions. An execution model should state its approximations instead of hiding them inside an aggregate result.
Return to the fictional example. A signal is calculated after a bar’s closing price becomes known. If the simulator grants that exact closing price without explaining how the order would have been sent and filled, there is an unresolved question. You can examine another execution convention, but you should keep it consistent when comparing candidates and explain its relationship to available information.
The accounting needs a consistent definition of costs. If entry and exit prices already incorporate the spread, deducting it again as a separate charge can count it twice. If you use midpoint prices and omit the bid–ask difference, you could underestimate it. The solution is to inspect a complete trade, from its reference price to the final balance, using explicit units.
Do not combine current costs with historical prices without explanation. Where only an approximation is available, describe it as such and examine how the conclusion changes under reasonable alternative assumptions. A sensitivity test may reveal fragility; it does not automatically make the most favourable assumption a description of what would have happened.
Contracts, minimum order sizes and rounding rules matter too. A signal requesting a fractional quantity may not be executable in that form. If you evaluate a portfolio of systems, inspect simultaneous positions, margin use and shared constraints. Adding individual equity curves can answer a different question from simulating one account.
To preserve the result, save a sufficiently detailed trade record: decision, simulated execution, quantity, price, cost and exit reason. That record allows a sample to be reconciled manually. If the total cannot be reconstructed from its components, a positive OOS result has a basic interpretation problem before its stability is even discussed.
How many observations do you really have?
Two years can contain many bars and few trades. A thousand trades can be concentrated in a single episode. A long calendar and a large number of rows do not automatically describe how much distinct information an evaluation contains.
Start by counting what is relevant to the question. For a prediction, the number of decisions and their horizons may matter. For a strategy, you also need to consider overlapping positions, time exposed and how many episodes explain the result. In a portfolio, several trades from different robots may respond to the same market movement.
In the hypothetical example, imagine that almost all gains come from one particular week. The total result remains what it is, but its concentration changes what you can learn from it. It is useful to show that distribution and ask what happens during the rest of the period. There is no need to remove the week and present an alternative result as though it were the primary one.
Breaking the report down by months, years or predefined conditions can help describe behaviour. However, the more cuts you explore after looking at the curve, the more opportunities you have to find a convincing story. Distinguish breakdowns fixed in advance from observations that emerged while investigating the result.
Precision matters with uncertainty intervals too. A resampling procedure needs assumptions about which elements can be exchanged or regrouped. The SciPy bootstrap function documents how observations are resampled to obtain a distribution of a statistic. Using a standard implementation does not determine whether that resampling adequately represents temporal dependence between your trades.
When observations depend on one another, artificially increasing the number of resamples does not provide more independent information. A specific investigation must justify its unit of analysis and method. If you cannot yet do that, describing the sample and acknowledging the limitation is preferable to turning a mechanically calculated interval into an assurance of safety.
The search leaves a trace too
Suppose variant C was chosen from twelve recorded alternatives. Now imagine an apparently similar investigation in which you tried hundreds of rules, also changing assets, trading hours and metrics, but retained only twelve at the end. The two final lists have the same size; their selection histories differ.
The Probability of Backtest Overfitting, by Bailey, Borwein, López de Prado and Zhu, studies the problem of selecting strategies by historical performance from multiple alternatives. Its contribution supports paying attention to the search process, not just the candidate eventually presented. We will not use its methodology here to assign a probability to a particular system.
As a research practice, you can record each family tested, relevant changes and the criteria that prompted you to continue or discard it. You do not need to preserve every informal conversation to explain what matters. You do need enough information to prevent an extensive selection process from appearing to be a single idea examined once.
Human decisions count alongside automated parameters. Changing the optimisation objective, choosing another period after a loss or excluding an instrument because it worsens the average changes the procedure. The absence of a sophisticated optimiser does not remove these degrees of freedom.
One way to organise the work is to separate an exploratory phase, in which you can learn broadly, from a subsequent check with a fixed procedure. Exploratory work can be valuable and extensive. Clarity comes from identifying the point when the question stopped changing and a defined evaluation began.
Walk-forward: evaluating a changing procedure
Sometimes the object of study is not a fixed model but a rule that periodically retrains or selects systems. In that case, freezing every parameter once does not necessarily represent what you want to evaluate. You need to specify which parts of the procedure may change and which information may drive those changes.
Hyndman and Athanasopoulos describe time-series evaluation with a rolling forecasting origin. At each step, the information used to prepare the forecast precedes the observations being evaluated. This idea allows different horizons to be studied without arbitrarily mixing past and future.
For a trading application, you would need to add operational decisions: training-window length, update frequency, eligible universe, selection criterion and treatment of existing positions. If you retrain every month, do you keep the previous version’s positions or close them? When is the new model considered available? How are transition costs counted?
Walk-forward evaluation can be overfit if you try many window configurations across the entire historical record and choose the best without another evaluation. In that case, you have selected the whole procedure using those results. The temporal structure within each run does not erase the selection made between runs.
The scikit-learn nested cross-validation documentation illustrates the separation between an internal choice process and external evaluation. Its example is not a ready-made financial protocol. The relevant lesson is to identify which procedure is chosen at each level and which data are used to estimate its behaviour.
In our continuing example, you could investigate a new version that reassesses candidates every quarter. It would be a different object from fixed variant C. It would have its own specification, comparisons and evaluation. Presenting both results is possible, provided that the report does not switch between them according to which looks better.
What to freeze before opening the evaluation
A useful freeze should make it possible to repeat the work, not merely remember an intention. I suggest treating it as a small research contract. It does not need to be a lengthy document, but it should answer the questions that would materially change the result.
First, define the object. It might be a fixed rule, a trained model, a selection process or a portfolio with specified management. Describe its inputs and outputs. If the system depends on a manual decision, explain how that decision will be made and what information the person making it may see.
Second, identify the data and their boundaries. Save the origin, file or version used, dates, time zone and transformations performed. Describe the handling of gaps, duplicates, corrections and instrument changes. A copy of the code is insufficient if rerunning it downloads a different historical dataset without recording the change.
Third, fix the operational conventions. Include signal timing, simulated execution, position size, costs, rounding and shared constraints. Explain how the evaluation starts and ends. If open positions are valued at the end, specify the price and distinguish that valuation from a closing trade actually simulated.
Fourth, determine the measurements and interpretation rule. Choose which result answers the main question, which references will be used and which conditions would prevent the test from being interpreted. A data error or an insufficient sample, for example, might produce an inconclusive result. Anticipating that possibility avoids forcing a positive or negative conclusion.
Fifth, preserve the identity of what you will run. Keep code, configuration, dependencies and a verifiable identification of the files. A random seed may be necessary for some procedures, but it does not describe the entire environment by itself. If variability is expected, specify how it will be measured and which repetitions are planned.
Finally, write down which changes will be allowed after opening the block. Correcting a demonstrated error differs from optimising a condition because the curve disappoints, but both require traceability. For a correction, preserve the previous result, explain the defect and clarify which parts of the evaluation had already been observed before rerunning it.
This contract does not eliminate every bias. It reduces ambiguities you can control and makes review by another person easier. Its quality can be checked by trying to reproduce a trade and explain why the procedure made that decision using the information available at the time.
Interpreting an unfavourable result
Suppose C’s reserved evaluation finishes with losses. The first task is to check whether the experiment was executed as specified. Inspect data, code, units and accounting. A demonstrable discrepancy can invalidate the calculation; a loss alone does not establish that a programming error exists.
If the checks pass, preserve the result. It may indicate that the strategy did not maintain the behaviour observed during development under those conditions. Alternatively, too few observations might make it insufficient for a precise answer. The conclusion should match what was actually evaluated, without automatically extending to every strategy in the same family.
For subsequent investigation, separate the questions. One concerns why the result might have occurred; another asks whether a specific modification would improve it in a generalisable way. Retrospective analysis can suggest explanations, but another check is needed to distinguish a useful explanation from a story fitted to the equity curve.
In our example, you might observe that costs absorb almost all the gross result. That suggests a new question about trading frequency or execution. It does not justify removing costs from the report or presenting gross performance as a substitute for net performance. The unfavourable condition is part of the evidence that prompted the revision.
C might also make a profit. The review procedure remains necessary. Check concentration, accounting consistency and the stability of conditions, and preserve the limitations. One favourable result does not explain what will happen in every future regime or how much capital the same execution could support. The evaluation answers a bounded question.
A report another person can understand
A useful report lets someone follow the path from the question to the trades. You can begin with a sentence identifying the object and purpose: “a retrospective evaluation of a version fixed before consulting the reserved block”, provided that this describes what happened. If there was subsequent selection or revision, include it in that explanation.
Next, show the decision timeline and the blocks used. Explain the selection criterion, the number and nature of recorded alternatives and relevant modifications. You do not need to reveal a private implementation to explain that a period influenced selection. Product confidentiality and precision about its tests are compatible.
Present the result alongside costs, exposure, the number of trades and simulation limitations. Distinguish what was calculated, what was assumed and what has not yet been checked. If you include a teaching example or synthetic path, label it visibly so that it cannot be confused with a market observation.
Preserve a suitable route to reproduction for whoever needs to review the work: versions, configuration, authorised data and the trade record. The public report may be shorter than the technical record. Both should agree on the essentials and avoid a commercial simplification that changes the evaluation’s meaning.
To review your own work, try a small exercise. Draw one timeline for the data and another for your decisions. Mark where you chose rules, candidates, metrics and periods. Connect each decision to the information you consulted when making it. That second timeline often explains the difference between OOS written on a chart and an evaluation genuinely separated from development.
In your most recent backtest, which period remained outside every decision that led to the final version, and what record would make that verifiable?
To turn that timeline into a working record, use the trading experiment journal. If the strategy will be refitted repeatedly, continue with walk-forward windows and retraining: each new fit needs its own separation between selection and evaluation.



