From idea to testable hypothesis
Everything before this chapter was plumbing — necessary, but not a strategy. This chapter starts Part 8: turning a market observation into something you can actually test rather than just believe.
The difference between an idea and a hypothesis
"Stocks that gap up tend to keep going" is an idea — vague, unfalsifiable as stated. "Stocks that gap up more than 2% on volume 1.5x their 20-day average close higher than their open on 60%+ of days, measured across NIFTY 500 constituents from 2018-2024" is a hypothesis — specific, measurable, and either true or false in the data.
The five things every hypothesis needs before you write backtest code
- Universe — exactly which instruments (NIFTY 50? all F&O-enabled stocks? a specific sector?). Vague universes let you cherry-pick after the fact without noticing.
- Entry rule — a precise, mechanical condition. If a human couldn't apply it consistently by hand given the same data, it's not precise enough yet.
- Exit rule — equally precise: fixed target/stop, time-based exit, signal-based exit. "I'll know when to get out" is not a rule.
- Time period and market regimes covered — does your test period include a trending market, a choppy range-bound market, and a high-volatility shock? A hypothesis validated only on 2020-2021's post-COVID bull run tells you little about how it behaves in 2022's drawdown.
- Expected edge, stated before testing — write down what result would make you believe the hypothesis, *before* running the backtest. Otherwise it's trivially easy to convince yourself after the fact that whatever result you got was what you expected.
Where hypotheses actually come from
- Market structure — an edge tied to *why* it should exist (e.g. index rebalancing flows, expiry-day options pinning, FII/DII flow patterns) tends to be more durable than a purely statistical pattern with no causal story.
- Behavioral patterns — retail overreaction to news, momentum from herding, mean reversion from overextension.
- Someone else's published research — a starting point, not a finished strategy; always re-test independently on your own data and timeframe rather than trusting a backtest you didn't run yourself.
Write the hypothesis down before touching code
Hypothesis: NIFTY futures, opening range breakout (first 15-min high/low),
entered on a break with a stop at the opposite side of the range,
target 1.5x the range size, exit by 3:15 PM if neither hit.
Universe: NIFTY futures, current month only, 2019-2024.
Expected edge: positive expectancy from momentum continuation post-open;
acceptable if win rate ~35-40% with reward:risk ~1.5:1 or better.
This document is what chapters 81-88 will actually test — not a vague feeling that "breakouts work."