Back to knowledge
Strategy7 min read

Strategy design

Design the entry, exit, and position lifecycle

A complete strategy is more than an entry condition. Map every transition from signal to position close before coding.

Specify the entry precisely

Define the event that creates a signal, the price used for entry, the allowed trading window, and what happens if the order is rejected or delayed. ‘Buy when momentum is strong’ is not executable until momentum, timing, and order behaviour are explicit.

A rule should produce the same decision when replayed with the same data and state.

Exits shape the distribution

Stop-loss, take-profit, trailing, time-based, signal-reversal, and protection exits create different trade distributions. An entry can look promising with one exit and poor with another. Test the complete lifecycle rather than optimising the entry in isolation.

  • Define what happens when multiple exit rules trigger together.
  • Decide whether the stop is fixed, volatility-adjusted, or structural.
  • Record the reason each trade closed.
  • Include partial exits and position modifications in the specification.

Handle state explicitly

The algorithm must know whether it has no position, an entry pending, a live position, a closing request, or a protection halt. Explicit state prevents duplicate orders and makes restart recovery possible.

Draw the state machine before writing code. It is usually easier to find missing cases on paper than inside a live terminal.

Discuss this article

Ask a setup question, share a backtest, or compare notes with other algorithmic traders. Use a display name; your email remains private.

Create an account or sign in above to join the conversation.

Loading discussion…