High-performance backtesting and financial simulation framework for trading strategies and reinforcement learning agents. Async-first, Gym-like API in Rust.
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
}}