Expand description
Normalization functions for intra-bar ITH metrics.
Issue #59: Intra-bar microstructure features for large open deviation bars.
ORIGIN: trading-fitness/packages/metrics-rust/src/ith_normalize.rs COPIED: 2026-02-02 MODIFICATIONS: Extracted only the functions needed for intra-bar features
All outputs are bounded to [0, 1] for LSTM/BiLSTM consumption.
Issue #96 Task #197: Uses precomputed lookup tables for sigmoid and tanh to replace expensive transcendental function calls (~100-200 CPU cycles each).
Functionsยง
- logistic_
sigmoid - Logistic sigmoid function: 1 / (1 + exp(-(x - center) * scale))
- normalize_
cv - Normalize coefficient of variation (CV) to [0, 1] using logistic sigmoid.
- normalize_
drawdown - Normalize max drawdown to [0, 1].
- normalize_
epochs - Normalize epoch count to [0, 1] using rank-based transform.
- normalize_
excess - Normalize excess gain/loss to [0, 1] using precomputed tanh lookup table.
- normalize_
runup - Normalize max runup to [0, 1].