Entry Rule: A Clear Definition
What Makes an Entry Condition Clear and Testable?
An entry condition is the moment when you decide to open a new trade. It is the single most important decision point in your trading rules because it determines which trades you take and which you skip. A clear entry condition is objective, testable with historical data alone, and leaves no room for debate or hindsight judgment. This article teaches you how to write entry conditions that are specific enough for a backtest engine to execute, and specific enough that another trader could read your rule and know exactly when you would trade.
Quick definition: An entry condition is an objective, measurable trigger—based on price, time, volume, or an indicator—that signals the exact moment to open a new position.
Key takeaways
- Entry conditions must be testable with only historical data available at the time of the entry bar.
- Common entry types include price-based, time-based, volume-based, indicator-based, and combination entries.
- Write your condition in plain language first, then verify it can be tested without lookahead bias.
- The most powerful entries often combine multiple conditions: price action AND volume AND an indicator.
- Avoid conditions that rely on future data, human judgment, or phrases like "looks strong."
The Price Break Entry
The price break is one of the oldest and most testable entry types. You enter when the price exceeds a threshold—usually the highest price over the last N days or weeks.
Simple price break: "Buy at the close if today's close is above the highest close of the last 20 days."
This rule is clear. On any given day, you can check: Is the close above the 20-day high? Yes or no. If yes, you buy at the close (or the open of the next day, depending on your backtest convention). No ambiguity.
Intraday price break: "Buy if the price touches or exceeds the previous week's high during the current bar."
This is also testable. You have the high of the current bar; you have the previous week's high. Does the current bar's high exceed last week's high? If yes, enter.
The price break works because it's a simple mechanical rule. Traders call it "breakout trading." It works because breakouts often mark the start of trending moves. It doesn't always work, but it's unambiguous—you know instantly whether you would have taken the trade.
Time-Based Entries
A time-based entry triggers on a specific calendar date or time interval.
Day of week: "Buy the open on every Monday."
Day of month: "Buy the open on the 15th of each month."
Time of day: "Buy at 9:30 AM ET (market open)."
Anniversary or event: "Buy on the first trading day after quarterly earnings."
Time-based entries are simple to code and test, but they have no edge—no reason to expect them to work better than random. A trader who buys every Monday is not responding to a market signal; they're following a calendar. These entries are useful only as a baseline for comparison or as part of a larger rule (e.g., "buy on Mondays, but only if the price is above the 50-day MA").
Volume-Based Entries
A volume condition triggers when trading volume meets a threshold or condition.
High volume entry: "Buy if the volume is above the 20-day average volume."
Volume confirmation: "Buy only if the price closes above the 20-day high AND the volume is above average."
Rare volume spike: "Buy if today's volume is more than 3x the 20-day average."
Volume entries can work because high volume often accompanies strong price moves. A stock that breaks above a key level on low volume is weaker than one that breaks on high volume. Combining volume with price creates a more robust entry.
Indicator-Based Entries
An indicator entry uses a technical indicator—a mathematical calculation based on historical prices and volume.
Moving average crossover: "Buy when the 5-day MA crosses above the 20-day MA."
Momentum indicator: "Buy when the RSI falls below 30 (oversold) and then closes above 30."
MACD entry: "Buy when the MACD histogram turns positive (MACD crosses above the signal line)."
Bollinger Band entry: "Buy when the close is below the lower Bollinger Band (2 standard deviations)."
Stochastic entry: "Buy when the %K line crosses above the %D line in oversold territory."
Indicators are useful because they compress information. The RSI doesn't show you prices; it shows you whether the move has been strong or weak relative to recent history. That can be useful information. The catch is that indicators lag price. By the time an indicator tells you the market has turned, the turn may already be priced in.
Combination Entries: The Most Practical
The most robust entries often combine multiple conditions. Price AND volume AND an indicator. This filters out false signals.
Example combination entry:
"Buy if ALL of the following are true:
- The close is above the 50-day moving average.
- The price breaks above the 20-day high.
- The volume is above the 20-day average.
- The RSI is between 40 and 80 (not overbought, not oversold)."
This entry has multiple filters. A price break alone might trigger on a small spike with low volume. Adding the volume filter keeps you out. Adding the moving average filter keeps you out of downtrends. Adding the RSI filter keeps you out of exhaustion moves. The result is fewer trades, but potentially higher quality.
Decision tree
The Multiple Time Frame Entry
Some traders use different time frames for entry and confirmation. This can work, but you must be explicit.
Example: "On the daily chart, the price closes above the 50-day MA. Then, on the 15-minute chart, the price breaks above the last 5 bars' high. Enter."
This requires monitoring two time frames simultaneously. It's testable, but more complex to backtest. Make sure your backtest engine can handle multiple time frames, and make sure you've written down which time frame is primary (daily) and which is confirmation (intraday).
Order Type Entries
In live trading, you don't always buy instantly. You place an order—a limit order, a stop order, or a market order—and wait for it to fill.
Limit order entry: "Place a buy limit order at $95.00. If the price touches $95 during the day, the order fills and you're in the trade."
Stop order entry: "Place a buy stop order at $95.00. If the price rises to $95, the order triggers and you buy at market."
When backtesting, you need to decide: do you fill at the specified price, or do you fill at the next bar's open? The choice matters. In real trading, you might not get filled at the exact price. For conservatism, some traders assume they fill at the next bar's open.
Testing Your Entry Condition: A Checklist
Before you backtest, verify that your entry condition passes these tests:
Test 1: Does it use only historical data available at entry time? If your entry rule requires knowing the close of tomorrow, it fails. You don't know tomorrow's close when you're deciding to enter today.
Test 2: Can another trader read it and agree on when it triggers? If the rule is "buy when the price looks strong," that fails. One trader will buy at $95; another at $96. Rephrase to "buy when the close is above the 20-day high."
Test 3: Does it have a logical reason to work? "Buy every time the date ends in 7" has no reason. "Buy when volume is unusually high and price breaks a key level" has a reason.
Test 4: Is it specific about price, time, or threshold? "Buy when the momentum is high" is vague. "Buy when the RSI is above 70" is specific. "Buy when the close is above the 50-day MA and volume is above average" is even more specific.
Test 5: Does it work on all markets or only some? If your entry works only on tech stocks in bull markets, note that. Avoid overfitting: a rule too specific to one period often fails in other periods.
Real-World Entry Examples
Example 1: Trend Following Entry
"Buy at the market open if the previous day's close was above the 100-day moving average, and today's open is above yesterday's close."
This is a simple trend-following entry. It buys momentum in the direction of the longer-term trend. It's specific, testable, and based on the idea that trends tend to continue.
Example 2: Mean Reversion Entry
"Buy at the market open if the RSI is below 30 (oversold), the price is above the 200-day MA (don't short), and the volume is above average."
This entry bets that oversold conditions reverse. The 200-day MA filter keeps you out of falling trends. The volume filter confirms that the oversold move was real, not a dull fade.
Example 3: Gap Fill Entry
"If the market opens with a gap down (today's open is below yesterday's low), buy a limit order at yesterday's close. If filled during today's bar, enter. Otherwise, cancel the order."
This entry trades the tendency of gaps to fill. It's specific: you're buying at a specific price (yesterday's close), and you have a time limit (today only).
Common Entry Rule Mistakes
Mistake 1: Lookahead bias in time-frame mixing. You use the close of a daily bar to decide the entry, then use the intraday high of that same bar to decide the exit. But you can't see the high until the bar closes. Instead, enter on the close of one bar and exit on the next bar.
Mistake 2: Vague price levels. "Buy near support" is not a rule. Support where? At what exact price?
Mistake 3: Indicator without context. "Buy when RSI is below 30" might work in a range-bound market but fail in a falling trend. Add context: "and the price is above the 50-day MA."
Mistake 4: No position limit. If your entry rule can trigger multiple times per week, you might have dozens of positions open in a long backtest. Specify: can you enter the same symbol again while a previous trade is open? Usually no.
Mistake 5: Emotional language. "Buy when the price is breaking out aggressively" is emotional. "Buy when the close is above the 20-day high and volume is 1.5x average" is clear.
FAQ
What if my entry never triggers in the backtest period?
That's a valid result. Not every condition applies to every market. Document it and move on. Some traders will backtest 20 different entry ideas and find that 18 of them never trigger. That tells you something useful: those entries aren't suited to the market you're testing.
Can I use fundamentals (earnings, earnings per share) for entry?
Yes, but you must be careful about lookahead bias. You can't use earnings data until after the earnings are announced. If you want to buy after earnings, define the entry as "the open after the earnings announcement."
What if the exact entry price I want never trades in the backtest?
Then you don't get the entry in that case. Your limit order doesn't fill. This is realistic. In real trading, if you're trying to buy at $95 and the stock bounces to $95.50, you don't get filled. Your backtest should reflect that.
Can I change my entry rule if it doesn't work?
Yes, but change it because of a logical flaw, not because it didn't make money. If you test an entry and it loses money, that's a valid result. If you test an entry and realize it has lookahead bias, fix the bias and retest from the beginning.
Should I test different versions of my entry rule?
Yes. Test "buy above the 10-day high," then "buy above the 20-day high," then "buy above the 50-day high." This helps you understand which variation performs best. But do this before you settle on a final rule. Once you've chosen, stick with it.
How specific should my entry be?
Specific enough to be unambiguous, but not so specific that it overfits. "Buy when the close is above the 20-day high" is good specificity. "Buy when the close is above the 20-day high and the RSI is 47.23" is overfitting—you're optimizing to the specific numbers in the backtest.
Related concepts
- Defining Rules Before Backtesting — The broader framework for rule definition.
- Exit Rule: A Clear Definition — Once you enter, how do you exit?
- Stop Loss Rule in a Backtest — Defining the downside exit.
- Backtesting Overview — Why entry rules matter in the testing process.
Summary
An entry condition is the trigger that tells you when to open a position. It must be objective, testable, and free of lookahead bias. The most common entry types are price breaks (breakouts), time-based entries, volume entries, and indicator entries. The most robust entries combine multiple conditions: price action and volume and an indicator. Write your entry in plain language first, then verify that another trader would interpret it the same way you do. Test against lookahead bias by asking: would you know this information when entering? Price breaks and trend-following entries work because they respond to market structure. Mean reversion entries work because they catch oversold conditions. No entry works all the time; your job is to choose an entry that makes sense for the market you're trading and test it honestly. The difference between an entry rule that works and one that doesn't is often just one clear sentence.