chapaty 1.2.0

An event-driven Rust engine for building and evaluating quantitative trading agents. Features a Gym-style API for algorithmic backtesting and reinforcement learning.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// A generic trait for incremental indicators.
/// Designed to be object-safe so agents can hold `Box<dyn StreamingIndicator<Input=I, Output=O>>`.
pub trait StreamingIndicator: std::fmt::Debug + Send + Sync {
    type Input;
    type Output<'a>
    where
        Self: 'a;

    /// Update the indicator with the latest data point.
    fn update(&mut self, input: Self::Input) -> Self::Output<'_>;

    /// Reset the internal state to clear history (e.g., for a new trading session).
    fn reset(&mut self);
}