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.
pubfntime_in_force(&self)-> TimeDelta{self.state.canceled_at -self.state.created_at
}}