SpectralTickFlowSignal
QuantConnect.DataSource.SpectralTickFlowSignal
SpectralTickFlowSignal()
SpectralTickFlowSignal(line: str)
Bases: BaseData
Spectral Tick-Flow Signal: per-ticker daily signals derived from a proprietary transform-like analysis of US-equity tick flow. Each row summarizes one security for one trading day and exposes compact fields for screening, ranking, and research.
Signature descriptions:
-
Default constructor required by LEAN for serialization and cloning.
-
Parses a single headerless, positional CSV line into a data point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
line
|
Optional[str]
|
CSV line: date,trade_count,volume_variance_explained,volume_dominant_period_seconds,execution_score,execution_period_seconds,execution_size,execution_signed,execution_rayleigh,signature_count |
None
|
trade_count
trade_count: Optional[int]
Regular-trading-hours trade count for the security that day. Beyond gauging how active the tape was, it is the sample size behind every other field: the execution detector only runs on days with at least 3,000 trades, and small counts make all the statistics noisier. Also useful as a liquidity floor when screening.
volume_variance_explained
volume_variance_explained: Optional[float]
Share of the day's seasonally adjusted volume variation that pulsed at canonical execution intervals (10-300 seconds). Near zero means volume arrived without rhythm; higher values mean a clock-like volume pulse consistent with scheduled (TWAP-style) order slicing, so the field ranks names by how mechanical their volume flow was. Zero is also reported when the ticker lacks the few prior sessions needed to build its seasonal volume profile.
volume_dominant_period_seconds
volume_dominant_period_seconds: Optional[int]
The canonical interval (10, 15, 20, 30, 60 or 300 seconds) carrying the strongest periodic volume pulse - the cadence of the suspected slicing schedule, e.g. 60 means volume surged roughly once per minute. Zero when no periodic volume signal was detected.
execution_score
execution_score: float
Headline evidence that an execution algorithm was working the name: the size-specificity of the most periodic trade-size bucket multiplied by its phase coherence. Dimensionless and unbounded - single digits are unremarkable, tens and above indicate a clearly phase-locked, size-specific trade stream - and comparable across symbols, so it suits cross-sectional ranking. Zero means the day had too few trades to analyze. Exposed through the data point's BaseData.value.
execution_period_seconds
execution_period_seconds: Optional[float]
Seconds between the periodic trade arrivals behind execution_score - the child-order spacing of the suspected execution schedule (3-300 second band). Zero when no candidate was found.
execution_size
execution_size: Optional[int]
Trade size, in shares, of the bucket where the periodicity was found - the likely child-order size the suspected algorithm was printing on the tape. Zero when no candidate was found.
execution_signed
execution_signed: Optional[bool]
True when the periodicity is strongest in tick-rule signed (net directional) flow rather than raw trade counts: the periodic prints lean one way, suggesting a one-sided parent order rather than direction-neutral activity - typically the more actionable case.
execution_rayleigh
execution_rayleigh: Optional[float]
Rayleigh phase-coherence statistic of the strongest signal - how precisely its trades stick to their clock. Values near 1 are consistent with random arrival times; 4 or more is the dataset's confirmation threshold, and the statistic keeps growing with regularity and trade count, so larger is stronger.
signature_count
signature_count: Optional[int]
Number of distinct trade-size candidates that passed every confirmation gate (spectral peak, size specificity and phase coherence) - roughly how many execution algorithms appeared to run simultaneously that day. Zero means nothing met the confirmation bar; the other fields then still describe the best unconfirmed candidate.
end_time
end_time: datetime
The time this data point becomes available for consumption. The signals are computed from the full trading-day session and are only knowable after the 16:00 ET close, so the point describing day D must not be consumable during D. BaseData.time is day D at 00:00 ET and EndTime is one calendar day later, so LEAN first emits the point at 00:00 ET on D + 1, strictly after day D's close, which is what prevents look-ahead. (A Friday signal therefore surfaces on the Saturday; because the linked equity only trades on sessions, any resulting order still fills on the next trading session.) EndTime is a computed property with no setter, so it can never overwrite Time.
data_type
data_type: MarketDataType
Market Data Type of this data - does it come in individual price packets or is it grouped into OHLC.
time
time: datetime
Current time marker of this data packet.
value
value: float
Value representation of this data packet. All data requires a representative value for this moment in time. For streams of data this is the price now, for OHLC packets this is the closing price.
price
price: float
As this is a backtesting platform we'll provide an alias of value as price.
ALL_RESOLUTIONS
ALL_RESOLUTIONS: List[Resolution] = ...
A list of all Resolution
This Field is protected.
DAILY_RESOLUTION
DAILY_RESOLUTION: List[Resolution] = ...
A list of Resolution.DAILY
This Field is protected.
MINUTE_RESOLUTION
MINUTE_RESOLUTION: List[Resolution] = ...
A list of Resolution.MINUTE
This Field is protected.
HIGH_RESOLUTION
HIGH_RESOLUTION: List[Resolution] = ...
A list of high Resolution, including minute, second, and tick.
This Field is protected.
OPTION_RESOLUTIONS
OPTION_RESOLUTIONS: List[Resolution] = ...
A list of resolutions support by Options
This Field is protected.
is_fill_forward
is_fill_forward: bool
True if this is a fill forward piece of data
clone
clone() -> BaseData
Creates a deep copy of the instance. EndTime is computed from Time, so it is not copied explicitly; ExecutionScore is computed from Value, so copying Value carries it over.
data_time_zone
data_time_zone() -> Any
The data is computed over the US equity session, so its time zone is America/New_York.
get_source
get_source(
config: SubscriptionDataConfig,
date: datetime,
is_live_mode: bool,
) -> SubscriptionDataSource
Locates the per-symbol CSV file for this subscription.
is_sparse_data
is_sparse_data() -> bool
Not every ticker has a file for every date, so the data is sparse; disables missing-file logging.
reader
reader(
config: SubscriptionDataConfig,
line: str,
date: datetime,
is_live_mode: bool,
) -> BaseData
Parses one line of the source document into a data instance.
requires_mapping
requires_mapping() -> bool
Linked to US equities, which rename through time (e.g. HCN to WELL), so mapping is required.
supported_resolutions
supported_resolutions() -> List[Resolution]
One summary row per full trading day, so the only supported resolution is Daily.
to_string
to_string() -> str
Human-readable representation for debugging.
deserialize_message
deserialize_message(serialized: str) -> Sequence[BaseData]
Deserialize the message from the data server
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
serialized
|
str
|
The data server's message |
required |
Returns:
| Type | Description |
|---|---|
Sequence[BaseData]
|
An enumerable of base data, if unsuccessful, returns an empty enumerable. |
should_cache_to_security
should_cache_to_security() -> bool
Indicates whether this contains data that should be stored in the security cache
Returns:
| Type | Description |
|---|---|
bool
|
Whether this contains data that should be stored in the security cache. |
update
update(
last_trade: float,
bid_price: float,
ask_price: float,
volume: float,
bid_size: float,
ask_size: float,
) -> None
Update routine to build a bar/tick from a data update.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
last_trade
|
float
|
The last trade price |
required |
bid_price
|
float
|
Current bid price |
required |
ask_price
|
float
|
Current asking price |
required |
volume
|
float
|
Volume of this trade |
required |
bid_size
|
float
|
The size of the current bid, if available |
required |
ask_size
|
float
|
The size of the current ask, if available |
required |
update_ask
update_ask(ask_price: float, ask_size: float) -> None
Updates this base data with the new quote ask information
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ask_price
|
float
|
The current ask price |
required |
ask_size
|
float
|
The current ask size |
required |
update_bid
update_bid(bid_price: float, bid_size: float) -> None
Updates this base data with the new quote bid information
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bid_price
|
float
|
The current bid price |
required |
bid_size
|
float
|
The current bid size |
required |
update_quote
update_quote(
bid_price: float,
bid_size: float,
ask_price: float,
ask_size: float,
) -> None
Updates this base data with new quote information
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bid_price
|
float
|
The current bid price |
required |
bid_size
|
float
|
The current bid size |
required |
ask_price
|
float
|
The current ask price |
required |
ask_size
|
float
|
The current ask size |
required |
update_trade
update_trade(last_trade: float, trade_size: float) -> None
Updates this base data with a new trade
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
last_trade
|
float
|
The price of the last trade |
required |
trade_size
|
float
|
The quantity traded |
required |