Skip to content
All library documents

Inventory-Aware Market Making with the Avellaneda-Stoikov Model

Article MQL5 articles

Summary

The article explains how the Avellaneda-Stoikov model adjusts two-sided quotes to account for inventory, volatility, and order-flow liquidity. Its reservation price shifts away from the mid in response to signed inventory, risk aversion, volatility, and time remaining in the trading horizon. A separate spread formula combines volatility and horizon with an order-arrival intensity parameter; bid and ask quotes are placed on either side of the shifted price. The article also discusses rolling estimates for volatility and order-flow intensity and shows how the model can be implemented, checked, plotted, and simulated.

A comparison on historical EURUSD hourly bars reports lower inventory variation and positive ending P&L for adaptive quotes, while fixed quotes accumulated a larger long position and ended at a loss. These are results from a controlled simulation, not evidence of a forward-looking edge. The author stresses that retail MetaTrader accounts are price takers, so the model is best treated as a research and order-placement tool rather than proof that a user can earn market-making spreads. Parameter choices and historical results may not transfer to other settings.

Key ideas

  • The reservation price shifts against current inventory to encourage a return toward a flatter position.
  • The model's spread responds to volatility, the remaining trading horizon, risk aversion, and order-flow intensity.
  • The quoted bid and ask straddle the reservation price rather than the unadjusted mid.
  • A historical EURUSD simulation compares adaptive quotes with a fixed-spread approach and reports inventory and P&L outcomes.
  • The simulation illustrates model behavior but does not establish live market-making profitability.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.