chapaty 1.1.0

High-performance backtesting and financial simulation framework for trading strategies and reinforcement learning agents. Async-first, Gym-like API in Rust.
use crate::{
    data::view::MarketView,
    gym::trading::{action::Actions, config::ExecutionBias},
};

/// Carries all necessary data to validate and apply agent actions.
///
/// Decoupled from `Env` to allow `Ledger` to consume it directly.
pub struct ActionCtx<'env> {
    pub actions: Actions,
    pub market: MarketView<'env>,
}

/// Carries market data needed to update open positions (Mark-to-Market).
pub struct UpdateCtx<'a, 'env> {
    pub market: &'a MarketView<'env>,
    pub bias: ExecutionBias,
}

/// A summary of the results from applying a batch of actions.
#[derive(Default, Debug, Clone, Copy)]
pub struct ActionSummary {
    pub rejected: u32,
    pub executed: u32,
}