signal
signal
Point-in-time investment intent derived from scores, models, or rules.
Signals use only information available at each row. They express desired direction or exposure; they are not future-aware training targets, portfolio allocations, orders, or simulated fills.
Functions
| Name | Description |
|---|---|
| as_signal | Validate and copy a canonical QRT signal object. |
| combine | Return the aligned weighted mean of multiple signal objects. |
| cooldown | Require flat observations before re-entering a directional signal. |
| decay | Exponentially smooth signal updates using only current and prior rows. |
| delay | Delay intent by an explicit number of observations. |
| hold | Enforce a minimum observation count between directional state changes. |
| hysteresis | Create stable directional intent with separate entry and exit levels. |
| limit_turnover | Limit each row’s per-asset target change from the prior accepted value. |
| neutralize | Remove static asset exposures from every signal timestamp. |
| normalize | Normalize each timestamp’s scores across the available asset universe. |
| select | Select exact top and bottom asset counts at every timestamp. |
| target_exposure | Map normalized conviction to per-asset desired exposure. |
| threshold | Map scores to long, flat, and optionally short directional intent. |
as_signal
signal.as_signal(values)Validate and copy a canonical QRT signal object.
A Series represents one asset through time. A DataFrame represents a time-by-asset panel. Both forms require an ordered, unique index, numeric values, and finite non-missing observations.
combine
signal.combine(signals, *, weights=None)Return the aligned weighted mean of multiple signal objects.
Inputs must have exactly matching types and labels. Missing inputs are ignored per cell and the available non-negative weights are renormalized.
cooldown
signal.cooldown(values, *, periods)Require flat observations before re-entering a directional signal.
Exits are immediate. A direct sign reversal is treated as an exit, and the opposite side may enter only after periods subsequent rows have been kept flat.
decay
signal.decay(values, *, half_life)Exponentially smooth signal updates using only current and prior rows.
delay
signal.delay(values, periods=1)Delay intent by an explicit number of observations.
The default one-row delay makes a score observed at row t available as intent at row t + 1. A zero delay is allowed only when same-row availability is deliberate.
hold
signal.hold(values, *, periods)Enforce a minimum observation count between directional state changes.
Missing proposals remain missing and do not change the held state. A periods value of one permits a change on every adjacent observation.
hysteresis
signal.hysteresis(
values,
*,
long_enter,
long_exit,
short_enter=None,
short_exit=None,
initial=0,
)Create stable directional intent with separate entry and exit levels.
Missing scores produce missing output and leave the internal state unchanged. When short levels are supplied, a score may reverse directly from long to short or short to long at the corresponding entry level.
limit_turnover
signal.limit_turnover(values, *, max_change, initial=0.0)Limit each row’s per-asset target change from the prior accepted value.
neutralize
signal.neutralize(values, exposures, *, weights=None, add_intercept=True)Remove static asset exposures from every signal timestamp.
This is the time-panel signal adapter over q.cross_section.neutralize. Exposure and optional weight indexes must exactly match the signal’s asset columns.
normalize
signal.normalize(values, *, method='zscore')Normalize each timestamp’s scores across the available asset universe.
"percentile" maps ranks to [-1, 1] with zero for a one-asset cross-section. "zscore" delegates to q.cross_section.zscore.
select
signal.select(values, *, long_count=1, short_count=0)Select exact top and bottom asset counts at every timestamp.
Ties are resolved stably by the input column order. Missing scores remain missing, selected assets become 1 or -1, and other valid assets become 0.
target_exposure
signal.target_exposure(values, *, maximum=1.0, clip=True)Map normalized conviction to per-asset desired exposure.
Values in [-1, 1] map linearly to [-maximum, maximum]. By default, stronger scores are clipped to that conviction range. This function does not impose portfolio gross, net, leverage, or capital constraints.
threshold
signal.threshold(values, *, long_above, short_below=None)Map scores to long, flat, and optionally short directional intent.