Skip to content

Signal generation

Signal generation turns eligible information into a trading forecast or decision state. Trace a 10% price-deviation score into a long signal, then separate sizing, orders and feasible execution.

Signal generation is the process of turning eligible information into a specified trading forecast, ranking or decision state. In systematic trading, it makes an idea reproducible: given the same information and model state, the rule should produce the same output. Its practical consequence is a decision that can be tested and acted on, with a clear record of when that decision became possible.

A signal may express an expected return, a relative preference between assets, or an instruction to seek a long, short or flat position. It is not automatically a probability, a position size or a completed trade. The output's meaning must be part of the rule.

From a measurement to a decision

These terms describe different jobs, even when a small strategy puts them in one function:

StageWhat it producesExample
Feature constructionAn input describing the market or issuerA price's deviation from its trailing average
TransformationA changed representation of an inputScaling deviations or ranking them across eligible assets
ScoringA number used to compare opportunities or apply a decision ruleA continuous trend score
Signal generationThe forecast or decision state passed onwardSeek a long position when the score exceeds a threshold
Position sizingA target exposure subject to capital and risk constraintsA chosen share quantity or portfolio weight
Order generationInstructions to change current holdings toward that targetA buy order with a specified quantity and order type

A transformed feature can itself be the score; a separate predictive model is optional. Conversely, a model's numerical prediction may still need a decision rule before it becomes an actionable signal. Terminology varies between research teams, so naming the output and its units matters more than insisting on one software architecture.

For an implementation example of this separation, QuantConnect's framework documentation distinguishes signal objects, portfolio targets, risk adjustments and execution. That architecture is one useful convention, rather than a universal definition of every trading system.

A threshold rule with an explicit clock

Consider one fictional stock, with prices in USD per share. There are no corporate actions during the example, so all prices use one consistent basis. Its five preceding session closes are 98, 99, 100, 101 and 102. The lagged moving average is their simple arithmetic mean:

mt−1=98+99+100+101+1025=100.m_{t-1}=\frac{98+99+100+101+102}{5}=100.

The current session's final close, ptp_t, is 110. It is excluded from that reference average. Define the dimensionless score

zt=ptmt−1−1=110100−1=0.10=10%.z_t=\frac{p_t}{m_{t-1}}-1=\frac{110}{100}-1=0.10=10\%.
For this long-or-flat illustration, fix the rule before evaluation:
st={+1,zt>0.05,0,zt≤0.05.s_t= \begin{cases} +1,&z_t>0.05,\\ 0,&z_t\le 0.05. \end{cases}
Here +1+1 means desired long state and 00 means desired flat state. The score exceeds the 5% threshold, so the rule emits +1+1. At a close of 105, the deviation would be exactly 5% and the strict inequality would produce 00. A negative score also produces 00 under this rule; it does not create a short position.
The 10% is a price deviation from a reference, not a forecast of a 10% gain. The rule expresses a trend-following hypothesis: unusually high prices relative to a trailing reference may be followed by continued strength. Whether this particular hypothesis has predictive value requires evidence; these invented prices supply none.
All five prior closes must have been received and validated, and the current final close must become usable before the signal is calculated. For this example, the final close becomes usable only after the current session closes. The execution policy permits trading at the next available session, subject to the order and fill assumptions. No price or filled quantity is supplied here.
Synthetic signal sequence: five prior closes average USD 100 per share; the current final close of 110 gives a 10% score above a 5% threshold and emits a desired-long-state signal of +1 after receipt. Sizing and orders precede any possible fill in the next available session.
Synthetic signal sequence: five prior closes average USD 100 per share; the current final close of 110 gives a 10% score above a 5% threshold and emits a desired-long-state signal of +1 after receipt. Sizing and orders precede any possible fill in the next available session.
Original synthetic sequence. Prices are USD per share; the diagram shows causal stages, not elapsed-time distances. The final close is an input, while execution is a later, uncertain event.
A backtest that computes this signal from the final close and awards a purchase at that same already-completed close has introduced look-ahead bias. A closing-auction strategy can be a valid different policy, but its decision must use information available before the relevant order deadline. Receiving the final close afterwards does not provide that information retrospectively.
The full Observation, Event and Availability Timestamps lesson develops the clock sequence from usable inputs to decisions, orders and possible fills. Its preview is public; the full lesson requires membership. QuantConnect's time-model documentation also illustrates why complete bars must become available before a strategy consumes them.

Specify persistence, missing data and evaluation

Under the desired-state convention above, another +1+1 means the long preference persists. If the position already equals its approved target, no additional purchase is needed. “Buy again whenever the condition is true” is a different rule with different exposure. Likewise, a flat signal may require selling an existing position, whereas missing data may require withholding a decision. Those outcomes should not silently share the same code.

Specify the instrument universe, feature windows, update frequency, entry and exit conditions, signal expiry and missing-data policy. A newly listed stock without the full five-session history is ineligible for this example's calculation. A zero or invalid reference price must also be rejected rather than divided into a score.

Any fitted transformations or model parameters must use information eligible at the decision time. A historically dated feature can still leak future information if its scaling or model coefficients were fitted on the entire sample. Chan's discussion of look-ahead bias makes this point using regression-based trading signals.

Finally, keep two questions distinct: does the signal predict the stated outcome, and can a portfolio exploit it after constraints, transaction costs and slippage? Good signal generation makes both questions precise. It does not answer either by itself.

Sources

  • Ernest P. Chan, Quantitative Trading: How to Build Your Own Algorithmic Trading Business (John Wiley & Sons, 2009), Chapter 3, “Look-Ahead Bias,” pp. 51–52. Explains unavailable future information, lagged feature calculations and leakage from fitting coefficients on the full dataset.
  • QuantConnect, Algorithm Framework: Overview, “Important Terminology” and “System Architecture.” Documents the separation of signals, portfolio targets, risk and execution.
  • QuantConnect, Time Modeling: Timeslices, “Time Frontier.” Explains data delivery after the relevant bar end and the role of information timing in avoiding look-ahead bias.
Last updated
  • signal generation
  • systematic trading
  • features
  • point in time data
  • execution
← Back to the glossaryBack to top ↑