Turning an idea into a testable rule set
Learn how to convert a vague trading idea into entry, exit, risk, filters, and failure conditions so it can actually be backtested. Educational, not advice.
Part of the Backtesting and Research track on Agenticks. About 11 minutes, written for a advanced reader.
You have an idea. Maybe it is "price tends to bounce off the prior day's low in the first hour." That is a hunch, not a strategy. A hunch lives in your head, where you get to decide after the fact whether each example counted. A rule set is the same idea written down so precisely that a computer, replaying history bar by bar, would take exactly the trades you would, with no judgment calls. The whole point of a backtest is to remove your opinion from the loop, and that only works if the rules leave nothing to interpret.
Five parts make an idea testable
A complete rule set answers five questions: Entry (what exact condition puts you in a trade), Exit (what takes you out, both for profit and for a loss), Risk (how much you lose if you are wrong, on every single trade), Filters (the conditions that must be true before you even look), and Failure conditions (what would tell you the whole idea is broken). Miss any one and your test is either impossible to run or quietly dishonest.
Start with entry and exit, because they are where vague language hides. "Buy when it looks strong" is not testable. "Buy at the open of the first bar that closes above yesterday's high" is. The same goes for the way out. You need a profit exit and a loss exit, and they must be specific: a price level, a number of bars, a percentage, or a multiple of your risk. If you cannot say in one sentence what gets you in and what gets you out, you do not have a rule yet, you have a feeling.
Risk is the part beginners skip and professionals obsess over. Before you think about profit, decide what one loss costs. Fixing risk per trade lets you measure results in R-multiples, where one R is the amount you risked. A trade that makes twice what you risked is a plus two R; a trade that hits your stop is a minus one R. Thinking in R instead of dollars is what later lets you read expectancy, the average R you would expect to win or lose per trade across a large sample. Without a fixed risk, the same idea can look brilliant or broken depending only on how big you bet.
Filters narrow, failure conditions protect
A filter is a gate: only consider the trade when something is already true, like "only between the open and 11am" or "only when the day's range is above its average." Filters cut out the setups the idea was never meant for. A failure condition is different: it is the line in the sand that says the idea itself is dead, like "if it loses on twenty trades in a row in a calm market, stop trading it." Filters shape each trade; failure conditions protect you from clinging to a broken idea.
Put the steps in the order you should actually build a testable rule set.
- Write the entry as one exact, unambiguous condition
- Define both exits: where you take profit and where you take a loss
- Fix the risk per trade so results can be read in R
- Add filters that limit the idea to the conditions it was built for
- State the failure conditions that would make you abandon the idea
- Entry
- The exact condition that puts you into a trade
- Exit
- What takes you out, for both profit and loss
- Risk per trade
- How much you lose when a single trade is wrong
- Filter
- A condition that must be true before you consider a trade
- Failure condition
- The sign that the whole idea is broken and should be dropped
Here is the translation in practice. The hunch was "price bounces off the prior day's low in the first hour." Written as a rule set it becomes: Filter, only act between 9:30am and 10:30am. Entry, go long on the open of the first bar that trades down to the prior day's low and then closes back above it. Exit, take profit at one times your risk, take the loss if price closes below the prior day's low. Risk, lose no more than a fixed amount per trade, sized from the distance to that stop. Failure condition, if the prior-day-low level stops holding across a large sample, treat the edge as gone. Notice that nothing in that paragraph requires a human to decide anything in the moment.
entry exit risk filters failure
What is the real job of a failure condition, separate from a normal stop loss? It defines, in advance, what would make you abandon the whole idea A failure condition retires the strategy itself when the evidence says the edge is gone. A stop loss only ends one trade.
One warning as you write rules. Every specific number you choose, the one-hour window, the one-times-risk target, the exact stop, is a parameter, an adjustable setting. Parameters are necessary, but each one is a knob you could later turn until the past looks perfect. The discipline is to choose them for a reason you can state out loud before you test, not to tune them afterward until the equity curve is pretty. A rule set with three honest parameters is far more trustworthy than one with a dozen that were all nudged to fit history.
You can now write an idea as a rule set
You learned the five parts: entry, exit, risk, filters, and failure conditions, and how to turn a hunch into rules a backtest can replay without judgment.
Common questions
- Why can't I just backtest a chart pattern I see?
- A pattern you recognize by eye is not yet a rule a computer can replay. Until entry, exit, and risk are written so the same conditions trigger the same action every time, there is nothing precise to test, and your eye will quietly cherry-pick the good examples.
- What is the minimum a rule set needs before testing?
- At least a defined entry, a defined exit, and a risk amount per trade. Filters and failure conditions make the test more honest, but with no entry, no exit, and no risk, a backtest has nothing concrete to measure.
- Are failure conditions the same as a stop loss?
- Not quite. A stop loss is one exit on a single trade. A failure condition describes when the whole idea should be considered broken, for example a market regime where it stops working, so you know in advance what would make you abandon it.
Terms defined in this lesson
Continue
Sources