An event-driven Rust engine for building and evaluating quantitative trading agents. Features a Gym-style API for algorithmic backtesting and reinforcement learning.
usechrono::TimeDelta;usecrate::gym::trading::state::{Canceled, Trade};implTrade<Canceled>{/// Calculates how long the order was pending before cancellation.
#[must_use]pubfntime_in_force(&self)-> TimeDelta{self.state.cancel_ts -self.state.created_at
}}