An event-driven Rust engine for building and evaluating quantitative trading agents. Features a Gym-style API for algorithmic backtesting and reinforcement learning.
useserde::{Deserialize, Serialize};/// A precise floating-point accumulator using the [Kahan Summation Algorithm](https://en.wikipedia.org/wiki/Kahan_summation_algorithm).
/// Implemented using move semantics for functional, immutable state
/// transitions.
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)]pubstructKahanSum{sum:f64,
c:f64,
}implKahanSum{/// Consumes the current state and yields a new [`KahanSum`] containing the
/// updated running totals.
pubfnadd(self, value:f64)->Self{let y = value -self.c;let t =self.sum + y;let c =(t -self.sum)- y;Self{ sum: t, c }}/// Returns the current mathematically compensated sum.
pubconstfnvalue(self)->f64{self.sum
}}