1. Algorithmic Execution as Markov Decision Process (MDP)
Executing institutional blocks ($10^5 - 10^7$ shares) requires balancing Implementation Shortfall market impact against unhedged inventory timing variance.
$$\mathcal{J}(u) = \mathbb{E}\left[ \int_0^T \left( \text{Impact Cost}_t + \lambda q_t^2 \sigma^2 \right) dt \right]$$2. Avellaneda-Stoikov Reservation Price Shift
For a market maker managing inventory $q \in [-Q, +Q]$, quotes are posted around reservation price $R(s, q, t)$:
$$R(s, q, t) = s - q \gamma \sigma^2 (T - t)$$import numpy as np
def compute_avellaneda_stoikov_quotes(mid_price: float, inventory_q: float,
gamma: float, sigma: float, time_rem: float, k_param: float) -> dict:
"""
Computes Avellaneda-Stoikov reservation price and asymmetric bid/ask quote depths.
"""
res_price = mid_price - inventory_q * gamma * (sigma ** 2) * time_rem
total_spread = gamma * (sigma ** 2) * time_rem + (2.0 / gamma) * np.log(1.0 + gamma / k_param)
bid_depth = mid_price - res_price + 0.5 * total_spread
ask_depth = res_price - mid_price + 0.5 * total_spread
return {
'Reservation_Price': res_price,
'Optimal_Bid_Px': mid_price - bid_depth,
'Optimal_Ask_Px': mid_price + ask_depth
}
3. Institutional Summary
- Inventory Skewing: Automatically lower both bid and ask prices when holding long inventory to attract buyer flow.