Skip to main content

Module analytics

Module analytics 

Source
Expand description

Pure on-demand market-state and price-level snapshots. On-demand analytical snapshots over chronological OHLCV bars. These are pure computations: no provider, persistence, strategy scheduling or UI dependencies. Callers provide finite input bars and applicable volume data. Timestamp values are not inspected. Output enums/fields preserve the existing consumer wire representation with the serde feature.

Structs§

ActivityReading
CheatSheetLevel
CheatSheetReading
FearGaugeReading
FearGreedReading
MonthStatistics
What the completed observations of one calendar month say.
MonthlyReturn
One calendar month’s return, measured close to close across the month boundary.
PriceSummary
RegimeReading
SeasonalityReport
Monthly seasonality of a price series: what each calendar month did, historically.
TrendPersistenceReading
TrendReading

Enums§

CheatSheetLevelKind
CheatSheetLevelSide
FearGaugeState
FearGreedDriver
FearGreedState
MarketPhase
Five-step market phase. “Strong” means the regime vote also calls it Trending, not just that direction is non-flat — a directional move inside a Ranging read (still choppy, just currently drifting) is the plain Up/Down.
PositionAlignment
RegimeState
TrendDirection
TrendPersistenceDirection
TrendPersistenceSensor
Which of the four sensors currently drives (driver) or drags down (drag) the composite score, to explain a change of the score.
TrendPersistenceState

Functions§

activity_reading
atr_percentile is the caller’s already-computed PriceSummary::atr_percentile. use_volume toggles the volume component; window bounds how far back “recent history” reaches for the volume percentile.
atr_distance
Unsigned price distance in ATR units; unavailable for a non-positive ATR.
cheat_sheet
Price levels around the last close, from the last window bars (120 for 0, at least 2, at most all). None for fewer than 2 bars, a window without range, or a non-positive last close.
classify_trend_regime
Classifies the regime from bars (oldest first). None until enough bars exist to seed all three measures. adx_len also drives the ADX smoothing window (Wilder default: both 14); window is the lookback for Choppiness and the Efficiency Ratio.
fear_gauge_reading
Reads the current fear/complacency state from bars (oldest first, current bar last). None until enough bars exist to seed the WVF window and its spike band (WVF_LEN + BAND_LEN - 1).
fear_greed_reading
Instrument sentiment 0..=100 from five component scores, each 0..=100 and 50 while its reading is missing:
monthly_seasonality
Computes the monthly seasonality of a bar series.
position_alignment
price_summary
Builds the summary from bars (oldest first). atr_len is the Wilder ATR period, stop_mult the ATR multiple for the suggested stop. None for fewer than atr_len + 1 bars.
trend_persistence_reading
Reads the current trend-persistence state from bars (oldest first, current bar last). None until enough bars exist to seed the four sensors’ LEN-bar window, the SMOOTH_LEN-bar composite smoothing, and the Adx indicator’s own warmup.
trend_reading
Direction from a smoothed price’s slope over len bars (kind/ jma_phase/jma_power select the kernel), combined with regime’s trend/range vote into a 5-step phase. deadband_pct is the minimum |slope_pct| to call it Up/Down instead of Flat — keeps noise from flipping direction every bar. None until the kernel has published len + 1 values, or for a zero reference value; slope_pct = 100 · (s_last / s_(last-len) - 1) over those published values.