Expand description
Indicator metadata — the descriptor layer for chart-page auto-discovery.
This module is purely additive metadata. It does not touch the compute
API (ema(), rsi(), the Indicator trait, the runtime IndicatorRegistry)
— existing consumers keep working unchanged. Its job is to describe, in a
machine-readable and JSON-serializable form, what parameters each indicator
takes so a front-end (janus catalog API → chart page) can render controls
for every indicator without hard-coding them.
§The one-obvious-place pattern
catalog() is a hand-maintained registry: one entry per indicator,
co-located in this file. When you add a new Rust indicator to the crate, you
add exactly one thing here — a IndicatorDescriptor with honest
ParamSpecs that mirror its factory() constructor params (the same keys
and defaults the factory reads from the params map). That single edit is what
makes the new indicator show up in the UI. There is no codegen and no derive
magic on purpose: the descriptor is the source of truth for the UI, and
keeping it explicit keeps it honest.
Rule of thumb: the default/min/max of each ParamSpec must match the
param_usize/param_f64 default the corresponding factory() uses, and the
id must match the lowercased name the indicator is registered under in the
runtime crate::registry::IndicatorRegistry.
Structs§
- Indicator
Descriptor - Machine-readable description of one indicator, for UI auto-discovery.
- Param
Spec - A single tunable parameter of an indicator.
Enums§
- Indicator
Category - Where an indicator is drawn on a chart.
- Param
Kind - The numeric type of a tunable parameter.
Functions§
- catalog
- The hand-maintained catalog of every indicator in this crate.