Signal generation, defined
Signal generation is the process of transforming inputs (for example, indicator values from a price series, model outputs, or rules-based observations) into an output that can be used by an automated or human decision process. In this article, “signal” means a structured result such as a timestamped classification (e.g., bullish/bearish/neutral) or a rule output (e.g., “cross condition met”), not a guarantee of future outcomes.
A worked example is a transparent numerical or scenario walkthrough where every assumption is stated, every calculation is shown, and the reader can re-run the same steps with the same inputs.
Worked example: rule-based signal generation with explicit assumptions
Assume we generate a signal once per time step using a simple rule based on two moving averages.
Assumptions (state upfront)
- Data: We use a fixed, historical set of “closing prices” at regular intervals. No real-time data is assumed.
- Time step: Prices are sampled every 1 hour.
- Window lengths: Short average uses 3 points, long average uses 5 points.
- Computation: Simple moving average (SMA) is used.
- Signal rule: If SMA(3) > SMA(5) → “UP”; if SMA(3) < SMA(5) → “DOWN”; if equal → “NEUTRAL”.
- Costs and execution: For this example, we do not convert signals into trades, and we ignore costs and slippage.
Scenario inputs
Consider the last 5 closing prices (most recent at the right):
- 1 hour ago: 101
- 2 hours ago: 102
- 3 hours ago: 100
- 4 hours ago: 99
- 5 hours ago: 98
Compute:
- SMA(3) uses the last 3 points: (100 + 99 + 98) / 3 = 297 / 3 = 99.0
- SMA(5) uses the last 5 points: (101 + 102 + 100 + 99 + 98) / 5 = 500 / 5 = 100.0
Apply the rule:
- SMA(3) = 99.0 and SMA(5) = 100.0
- Since SMA(3) < SMA(5), the generated signal is “DOWN” at the most recent timestamp.
What the reader can independently verify
A reader can verify the example by recomputing the two averages from the exact assumed numbers and confirming the comparison direction.
Mechanics: what is stable vs what is variable
Stable mechanics (the “how”):
- A defined input-to-output mapping (the computation method and rule).
- Clear timing (which bar or timestamp you compute on).
- Deterministic math (given the same inputs, you get the same output).
Variable conditions (the “what can change”):
- The input data itself: different providers or data cleaning can produce different price series.
- Timing and sampling: using different bar boundaries or update frequencies changes the computed averages.
- Execution context: even if you generate a correct signal, real-world use depends on execution timing, transaction costs, and platform behavior.
Limitations and failure modes to expect
- Data mismatch: If live inputs differ from the assumed series (even slightly), the generated signal can flip.
- Lookahead and leakage: If a rule accidentally uses information from after the timestamp, it may appear to work in testing but will not hold when run properly.
- Sensitivity to parameters: Window lengths (3 and 5 here) are choices; changing them changes the signal frequency.
- Non-stationarity: Relationships that appear in historical data may not persist.
Because outcomes vary with market conditions, costs, execution, and jurisdiction, a worked example should be interpreted as demonstrating mechanics, not forecasting.
Verification and next question
To verify signal generation independently, focus on the same checklist: (1) stated assumptions, (2) explicit computations, (3) the rule that maps computed values to the output label, and (4) clear timestamping.
A next step is to repeat the worked example with a different, still-assumed input series and observe how the signal changes when SMA(3) crosses SMA(5), while keeping the mechanics identical.