Function market_posture_signal
pub fn market_posture_signal(
profile: &FinanceProfile,
volatility: &FinanceSignal<VolatilityScaleResult>,
jump_event: &FinanceSignal<FinanceEventDetection<JumpEventResult>>,
trend_regime: &FinanceSignal<TrendRegimeResult>,
band_energy: Option<&FinanceSignal<WptBandEnergyResult>>,
config: &MarketPostureConfig,
) -> Result<FinanceSignal<MarketPosture>>Expand description
Compute a composite market posture from required EOD Wave Pack signals.
The posture rule is intentionally transparent. An active jump/stress event —
one that is both recent and at least config.event_label_min_warning (see
MarketPostureConfig and the posture_active_event helper) — dominates the label;
otherwise trend/regime direction selects the posture. Gating on recency and
severity keeps the EventDriven label selective: a routine Watch-level blip,
or a months-old jump still sitting in the trailing window, no longer saturates
the posture.
composite_score is a weight-normalized, signed risk-on/off aggregate (see
the posture_composite_score helper). The volatility driver is signed — calm tape is
Constructive, stressed tape Risk — rather than always-neutral, and the
optional spectral-entropy driver is likewise signed (stable spectrum
Constructive, diffuse/unstable Risk). Together with normalization this lets
the score reach genuine risk-on territory instead of the old +0.40 cap.
The optional band_energy signal contributes the spectral-entropy /
regime-instability driver (weight 0.15): high normalised band-energy entropy
flags a diffuse, unstable spectral regime. It is optional because the WPT
fingerprint uses a different transform than the posture’s MODWT inputs and so
is not part of the single-profile default request; when None (or
unavailable) the posture is still computed from the other signals, just without
the entropy driver (graceful degradation). The profile parameter stamps
methodology metadata.