Skip to main content

Module applicability

Module applicability 

Source
Expand description

Plausibility check between an indicator’s data requirements and a series’ capabilities. Plausibility check between what an indicator’s calculation needs from a bar series (crate::applicability::DataRequirements) and what a series actually provides (crate::model::SeriesCapabilities).

build_checked (see crate::indicator::registry) validates parameters — periods in range, threshold ordering. It says nothing about whether the data fits the indicator: a volume-profile indicator run on tick-volume CFD data will compute a POC/VAH/VAL that looks plausible and measures nothing meaningful. Nothing in the type system prevents that. This module is the check that catches it: crate::applicability::check_applicability compares an indicator’s declared crate::applicability::DataRequirements against a series’ crate::model::SeriesCapabilities and returns a three-valued verdict (crate::applicability::Applicability) with factual, publication-ready explanations attached.

(Note: this module-level doc comment uses fully-qualified crate:: paths for its own items rather than bare names — rustdoc resolves intra-doc links here against the crate-root scope, not this module’s, because pub mod applicability; in lib.rs also carries an outer /// doc comment that gets merged with this file’s //! comment into one doc block for the module.)

Structs§

ApplicabilityNote
A single applicability finding: which rule fired, and a publication-ready explanation.
DataRequirements
What an indicator’s calculation needs from the bar series it runs over, beyond plain OHLC prices. All-false (the Default) is the right value for pure price indicators — the effort of declaring requirements is only spent on the indicators where it matters.
RuleDescription
Static description of one rule in check_applicability’s table: which reason it produces, which tier it falls into, and its publication-ready explanation. rule_catalog exposes all of them for the doc export (see the plan’s “Export für die Doku” section) — this is the single source both check_applicability and the export pull from, so the exported table can never drift from the rules actually enforced.

Enums§

Applicability
Three-valued result of matching an indicator’s DataRequirements against a series’ SeriesCapabilities.
ApplicabilityReason
Which rule in check_applicability produced a given ApplicabilityNote.
ApplicabilityTier
Which of the two non-Applicable buckets a rule belongs to.

Functions§

check_applicability
Matches requirements against capabilities and classifies the result.
data_requirements
Looks up the DataRequirements for a registry/catalog indicator name (case-insensitive, matching the .to_lowercase() convention used by crate::indicator::registry::build_checked/build_typed).
rule_catalog
All rules in check_applicability’s table, in the same order they are evaluated — the source the doc export (see the plan’s “Export für die Doku” section) reads from.