Realistic Market Impact Modeling for Reinforcement Learning Trading Environments

—

Realistic Market Impact Modeling for Reinforcement Learning Trading Environments

Lucas Riera Abbade
Anna Helena Reali Costa
Published on 3/30/2026
Equities
Stocks
United States (US)
Reinforcement learning
Machine learning
High frequency trading
Risk management
Backtesting

This paper addresses the reality gap in reinforcement learning (RL) for trading by introducing a suite of three Gymnasium-compatible environments—MACE stock trading, margin trading, and portfolio optimization—that incorporate realistic nonlinear market impact models based on the Almgren–Chriss (AC) framework and the square-root impact law. The environments feature pluggable cost models, permanent impact tracking with exponential decay, and comprehensive trade-level logging. The authors evaluate five DRL algorithms (A2C, PPO, DDPG, SAC, TD3) on the NASDAQ 100 universe, comparing a fixed 10 bps baseline cost model against the AC model with Optuna-optimized hyperparameters.

The results demonstrate that the cost model significantly affects both absolute performance and the relative ranking of algorithms across all three environments. For example, in stock trading, optimized PPO achieves 34% out-of-sample (OOS) total return under the baseline but only 25% under AC, while TD3 improves from 24% to 30%. The AC model also produces dramatically different trading behavior, reducing daily costs by 96% and turnover from 19% to 1% for non-optimized TD3. Hyperparameter optimization is shown to be essential for constraining pathological trading behaviors, such as unbounded growth in participation rates and turnover. The study also reveals strong interactions between algorithm choice and cost model that are environment-specific.

The paper's main contribution is the open-source release of a unified environment suite with realistic market impact, enabling more realistic RL trading research. The findings highlight the importance of cost modeling in RL trading environments and provide insights into how different algorithms respond to nonlinear cost signals, with implications for both practitioners and researchers in quantitative finance.

Highlights

  • 1Introduces MACE, a suite of three Gymnasium-compatible trading environments with realistic nonlinear market impact models (Almgren–Chriss and square-root law).
  • 2Demonstrates that the choice of cost model (flat 10 bps vs. Almgren–Chriss) materially affects both absolute performance and relative algorithm ranking across stock trading, margin trading, and portfolio optimization.
  • 3Shows that hyperparameter optimization (HPO) is critical to prevent pathological trading behaviors such as unbounded growth in participation rates and turnover.
  • 4Releases the full environment suite as an open-source extension to FinRL-Meta for reproducible research.

Methods

  • M
    Almgren–Chriss (AC) market impact model with permanent and temporary cost components and exponential decay of permanent impact.
  • M
    Square-root impact law for empirical price impact scaling with order size relative to average daily volume.
  • M
    Five deep reinforcement learning algorithms (A2C, PPO, DDPG, SAC, TD3) evaluated with Optuna-based hyperparameter optimization.
  • M
    Three trading formulations: long-only stock trading (MACE), long/short margin trading, and long-only portfolio optimization (POE).

Results

  • R
    In stock trading, optimized PPO achieves 34% OOS return under baseline but drops to 25% under AC; TD3 improves from 24% to 30% under AC.
  • R
    Non-optimized TD3 in stock trading sees daily costs drop from $200k to $8k (96% reduction) and turnover from 19% to 1% when switching from baseline to AC.
  • R
    In portfolio optimization, TD3 under AC achieves 32% OOS return (best overall) vs. 26% under baseline (worst among agents).
  • R
    HPO reduces trading costs by up to 82% (SAC stock trading) and prevents monotonically increasing participation rates across training epochs.
  • R
    Algorithm–cost model interactions are environment-specific: DDPG's margin Sharpe jumps from -2.1 to 0.3 under AC while SAC's drops from -0.5 to -1.2.
0/5

Analyze Paper

Generate insights from "Realistic Market Impact Modeling for Reinforcement Learning ...".

Suggested Actions