Skip to content

Entry rule

An entry rule defines when a strategy may open a position. Specify available inputs, position eligibility, repeat conditions and execution timing before backtesting.

An entry rule specifies the conditions under which a strategy may open a position. It turns available information into a reproducible decision about whether to enter. An entry rule can identify a buy candidate without determining the quantity, authorising the risk or guaranteeing an execution price.
“Buy when the price looks strong” leaves too much discretion for a backtest. A usable rule says which price, which comparison, when the inputs become available and which current positions or orders make the account eligible to enter.

A close above the prior average

Consider a fictional long-only rule evaluated after each session's final close has been received. Let CtC_t be that close, quoted in currency units per share, and define the average of the 20 preceding closes as
Mt−=120∑j=120Ct−j.M_t^- = \frac{1}{20}\sum_{j=1}^{20}C_{t-j}.

The superscript minus labels a prior-only average. The current close CtC_t is excluded, as are all future observations. Prices use a consistent basis; the example has no corporate actions. If the full prior history is unavailable, the rule produces no entry candidate.

Choose the following policy: if the account is flat, has no working entry order, and Ct>Mt−C_t>M_t^-, generate a buy-entry candidate. Equality does not qualify. The first permitted execution opportunity is in the next trading session, after the decision and order preparation. This is a chosen policy for the illustration.
Suppose the observed final close is 105 and the prior-20-close average is stipulated to be 100. The underlying observations are not supplied. Because 105 exceeds 100, the price condition passes. If the account is eligible, the entry rule generates a buy candidate.
Fictional prior twenty-close average 100 excludes the current close. Observed final close 105 meets the above-average condition. A flat account with no working entry order may generate a candidate after the close; the first execution opportunity is next session at an unspecified price. Holding a long position or a working entry order blocks another entry.
Fictional prior twenty-close average 100 excludes the current close. Observed final close 105 meets the above-average condition. A flat account with no working entry order may generate a candidate after the close; the first execution opportunity is next session at an unspecified price. Holding a long position or a working entry order blocks another entry.
Original synthetic rule and eligibility table. Prices are in currency units per share. The prior average is stipulated; no intraday path, subsequent price or fill is assumed.
This is an above-average rule, not a crosses-above rule. A crossover rule would also require evidence that the price was previously at or below its corresponding average. Adding that condition changes the strategy and requires another correctly timed observation.

A persistent condition is not another purchase

Under this policy, a filled long position makes the account ineligible for a new entry. If the price remains above its average, that repeated condition does not authorise buying more. A working entry order also blocks another entry, including when it is partly filled. Its remainder belongs to order management.

If a candidate is rejected by a risk check, or an unfilled order is cancelled, the strategy must specify when it may try again. The level-based rule above permits a later candidate once the account is flat, has no working entry order and again meets the condition. A policy requiring the condition to reset before re-entry would be a different rule. The trading signal, actual position and working orders must therefore be tracked separately.

Put the decision before the fill

Using the final close to make the decision and then granting a purchase at that same already-observed close would require execution evidence the example does not provide. In this next-session policy it would violate the timing convention. The moving average must also use only observations available to the strategy at the decision time; historical revisions cannot silently become earlier knowledge. These are practical safeguards against look-ahead bias.
The value 105 is a signal input, not an offered fill. A market order does not fix the execution price; a limit order imposes a price constraint but can remain unfilled. Investor.gov's order guide explains the distinction for U.S. securities orders.
For a worked treatment of those clocks, Observation, Event and Availability Timestamps follows information through receipt, computation, order arrival and possible execution. The full lesson requires membership; the linked page offers a public preview.

Entry is one part of a strategy

An entry rule still needs position sizing, an exit rule, risk limits and an execution policy. Costs, financing and actual cash flows are needed to assess profitability. A condition can be precise and reproducible while having no profitable forecasting value.
The direction of the condition is strategy-specific. A trend-oriented rule might buy above an average, as in this example. A mean-reversion rule might buy after a sufficiently negative deviation. Avellaneda and Lee's author preprint, section 4.1, gives a concrete mean-reversion policy with distinct opening and closing thresholds. Its rule does not validate the fictional moving-average condition here.

Sources

Last updated
  • systematic trading
  • decision rules
  • trading signals
  • backtesting
  • execution
← Back to the glossaryBack to top ↑