Starter article · illustrative research, not empirical findings
YDLib / Research methods / Article
Write the research contract before the backtest
A practical framework for turning an observation into a question that can fail, with data, costs and decision rules written down in advance.
Starter content · illustrative only. This is an example of how YDLib presents research. It contains no empirical results or validated trading edge.
An observation is the beginning
“Price often returns toward its session average” is an observation. It leaves the instrument, timing, definition of average and meaning of “often” unspecified. A useful research question fixes those choices before evaluating performance.
This example does not assert that mean reversion works.
Make the claim falsifiable
An illustrative question is: “After a defined deviation from a trailing session mean, is the probability of touching that mean before a fixed adverse barrier higher than a specified baseline within the next 60 minutes?”
Define the deviation, mean, barrier, eligibility rules and session cutoff. Use only information available at the decision time. A session-wide mean calculated after the close would introduce future information.
Write a small research contract
| Field | Write before testing |
|---|---|
| Observation | What was noticed, without claiming causation |
| Hypothesis | A measurable claim and comparator |
| Data | Provider, symbol, timezone, frequency and dates |
| Rules | Event eligibility, entry, exits and ambiguous bars |
| Costs | Spread, commission, slippage and financing where relevant |
| Validation | Chronological development and untouched holdout |
| Decision | What evidence would reject or justify further work |
| Limitations | Missing data, selection bias and execution uncertainty |
Preserve the unsuccessful work
Keep a log of variants and why they changed. A profitable result selected from hundreds of attempts needs different scrutiny from a single preregistered test.
Distinguish no evidence yet, inconclusive, rejected, and supported under stated assumptions. None automatically establishes live tradability.
Use the library as a chain of evidence
Keep the source and exact page or timestamp. Link it to the research project, then connect the measured signal and the strategy study. Store rules and chronological results with the study.
A reader should be able to move backward from a chart to the assumptions that produced it.
Status: educational framework. No empirical findings are presented.