Tool Calibrate Ask the model Model docs
Home Projects Contact
arrow_back FrontierView
science Model Documentation

Pre-Trade Market Impact Analysis

The model, assumptions, and trade-offs behind the Almgren et al. (2005) execution cost framework implemented in FrontierView.

codePython apiFastAPI auto_graphAlmgren et al. 2005 analyticsPre-Trade TCA
help_outline

What problem does this solve?

Every time an institutional investor wants to buy or sell a large position, they face a fundamental dilemma: trade quickly and pay more, or trade slowly and bear more risk. This is not a trivial problem. A fund managing $5 billion that routinely executes poorly can lose tens of millions of dollars a year to execution costs that never appear on a P&L line — they show up as slippage, as underperformance relative to benchmark, as the gap between the price you decided to trade at and the price you actually got.

FrontierView makes this trade-off visible. Given an order — a stock, a size, and a time horizon — it computes the expected cost and risk of execution across a range of strategies and shows you the efficient frontier: the set of strategies from which no improvement is possible without accepting more risk or paying more cost. This is the core question of pre-trade transaction cost analysis (TCA), answered every day by execution desks at hedge funds, asset managers, and investment banks using models exactly like this one.

info
Implementation shortfall. The gap between the price at which a trading decision is made and the average price actually achieved is called implementation shortfall. For large institutional orders it routinely exceeds commissions, fees, and bid-ask spreads combined — yet it rarely appears as a line item in performance attribution.

When a large investor buys shares, they move the market against themselves. Buying pressure pushes prices up; the more aggressively you buy, the more you pay above the arrival price. This is market impact — and unlike commissions or spreads, it scales non-linearly with order size and execution speed.

Temporary impact is the instantaneous price dislocation caused by your order hitting the book. It reflects the liquidity consumed in the moment. It decays after you stop trading. If you trade faster, you consume more liquidity per unit time and pay a higher temporary impact cost. Permanent impact is the information content of your order. The market infers that you have a view and reprices accordingly. This does not recover. Trading fast reduces exposure to permanent impact but increases temporary impact. Trading slowly reduces temporary impact but gives the market more time to move against you. The optimal schedule is different for every investor depending on how much uncertainty they can accept.

functions

The model

FrontierView implements the market impact model from Almgren, Thum, Hauptmann, and Li (2005), an empirical extension of the foundational Almgren-Chriss (2001) framework fitted to US equity trade data. It is the reference model taught in quantitative finance courses, cited in academic literature, and used as a baseline by TCA vendors.

warning
This is not the 2001 paper. Almgren-Chriss (2001) assumes linear temporary impact. The 2005 paper establishes empirically that temporary impact follows a power law with exponent ≈ 0.6 — a meaningful difference in how costs scale with participation rate. FrontierView implements the 2005 version throughout.

Functional forms

trending_up Temporary impact — h(v)
swap_horiz Spread cost — s
north_east Permanent impact — g(v)

All three expressions return dimensionless fractional price changes. Multiply by 10,000 to convert to basis points.

Variable definitions

Symbol Description Notes
v Trading rate Shares per hour — a rate, not a cumulative quantity
V Hourly ADV ADV / 6.5 trading hours per day (shares per hour); normalises v to a dimensionless participation rate
σ Daily return volatility Dimensionless (e.g. 0.0155 = 1.55%); per-symbol default
η Temporary impact coefficient 0.142 — Almgren et al. 2005, Table 3
γ Permanent impact coefficient 0.314 — Almgren et al. 2005, Table 3
ε Half bid-ask spread Per-symbol default; paid once per share regardless of speed
6.5 Trading hours per day US equities convention (9:30 am – 4:00 pm ET)

Execution schedules

Rather than solving a full numerical optimisation — which requires assumptions that cannot be validated without real order flow data — FrontierView compares four canonical execution strategies. Each is evaluated for expected cost and variance of execution shortfall.

Schedule Description Character
TWAP Equal participation rate throughout the horizon Neutral baseline; no market view implied
Front-loaded Exponentially decreasing participation rate Aggressive; accepts higher temporary cost to reduce market exposure time
Back-loaded Exponentially increasing participation rate Passive; accepts higher uncertainty to minimise initial impact
AC Linear Almgren-Chriss closed-form optimal under the linearised impact assumption Theoretically motivated; typically front-loaded

The efficient frontier

For each schedule, plotting expected cost (bps) against variance of cost (bps²) produces a point in cost–risk space. Together, these points trace an approximation of the efficient frontier — the boundary below which no strategy can achieve lower cost without accepting higher variance, or lower variance without accepting higher cost.

The frontier is indexed by a risk aversion parameter λ, which represents how much additional expected cost the trader is willing to pay to reduce variance by one unit. A λ of zero means the trader is indifferent to risk (minimise cost only); a high λ means the trader strongly prefers certainty over cheapness. This directly answers the question: given how risk-averse I am, what is the best way to execute this order?

account_tree

How it works

input User Input symbol · size direction · horizon
arrow_forward HTTP
api FastAPI market params ADV · vol · spread
arrow_forward compute
functions AC 2005 Model 4 schedules h(v) · g(v) · s
arrow_forward JSON
bar_chart Visualisations frontier · schedule decomposition
1

User inputs an order specification

The user provides a stock symbol, order size in shares, and the execution time horizon in hours. These three values fully define the trade-off space to be explored — the model has no free parameters at runtime beyond what the user supplies.

2

The API resolves market parameters and computes impact

The FastAPI backend (Python) looks up per-symbol market parameters — average daily volume, daily return volatility, and half bid-ask spread. It computes temporary impact, permanent impact, and spread cost for each of the four canonical execution schedules using the Almgren 2005 functional forms, then returns the frontier, schedule time series, and impact decomposition as a JSON response.

3

Three visualisations are rendered

The client renders three linked charts: the efficient frontier scatter plot (expected cost vs. execution variance for each schedule, with a λ slider that highlights the risk-aversion-optimal choice); the execution schedule chart (participation rate over time bins, showing how aggressively the order is worked throughout the horizon); and the impact decomposition bar chart (total cost broken into spread, temporary impact, and permanent impact components for direct comparison).

4

Model parameters are displayed explicitly

The interface surfaces all driving assumptions — symbol defaults for σ, ADV, and ε; the literature constants η and γ; and the derived participation rate for each schedule. This is intentional: the purpose of FrontierView is not to produce opaque numbers, but to show exactly how inputs map to outputs and which assumptions are load-bearing.

verified

What this demonstrates

FrontierView is a portfolio project. Its purpose is to demonstrate:

  • Fluency with quantitative execution models at the level expected of a buy-side technology role.
  • Understanding of the distinction between temporary and permanent impact, and why it matters for schedule design.
  • Ability to implement a non-trivial Python model cleanly, expose it via an API, and connect it to an interactive visualisation.
  • Intellectual honesty about model limitations — which, in a real TCA context, is exactly what separates credible analysis from dangerous overconfidence.
  • Verification of model correctness via property-based testing of mathematical invariants (schedule-invariance of permanent cost, frontier monotonicity, dimensional consistency of the impact denominators), including a schedule-invariance test that initially failed and surfaced a discretisation error in the path integral accumulator. The fix — switching from forward to midpoint accumulation — is documented in the Engineering Notes.
  • Demonstration of the Almgren-Chriss parameter estimation methodology — heteroskedastic WLS regression on synthetic fills with known ground truth — with calibration scatter plots, parameter recovery bar chart, and residual Q-Q plots against N(0,1), in the Calibration tab.
warning_amber

Limitations

These are not caveats buried in small print. They are explicit, intentional constraints on an MVP model, and understanding them is part of what the tool is designed to demonstrate. In a real TCA context, intellectual honesty about model limitations is exactly what separates credible analysis from dangerous overconfidence.

  • Parameters are not calibrated. η and γ are literature central estimates from Almgren et al. 2005 with material standard errors. Real TCA vendors calibrate these coefficients from their own execution data — millions of historical fills matched against contemporaneous market conditions. Without that data, the numbers are indicative, not predictive.
  • Volatility and ADV are static daily averages. Real impact models condition on realised intraday volatility, current order book depth, and time-of-day volume profiles. A 2 pm AAPL trade looks very different from an 8 am open or a 3:50 pm close. FrontierView uses daily averages throughout.
  • Equities only. The model assumes a centralised, lit exchange with a measurable average daily volume. FX spot is OTC, fragmented across venues, with no canonical ADV. Applying this framework to FX would require a fundamentally different microstructure model (e.g., Butz & Oomen, 2019).
  • No intraday volume profile. Real VWAP execution weights participation by expected intraday volume — higher at open and close, lower mid-day. FrontierView uses flat time bins throughout the execution horizon.
  • Canonical schedules, not a full numerical optimiser. The true Almgren-Chriss optimum with a 0.6 exponent has no closed-form solution (unlike the linear case). Solving it numerically introduces convergence complexity not warranted for a demonstration tool. The canonical schedule menu is an honest alternative: it shows where real strategies sit on the frontier without pretending to solve a problem that requires calibrated data to solve meaningfully.
  • Variance is execution shortfall variance, not P&L variance. The y-axis of the frontier measures uncertainty in execution cost relative to arrival price. It is not total portfolio P&L variance, which would include alpha decay, factor exposures, and other components entirely outside this model's scope.
  • Linearity of permanent impact is required by no-arbitrage. This is required by no-arbitrage (Huberman & Stanzl 2004) and is what makes permanent cost schedule-invariant under the path integral. Switching to a non-linear permanent impact function would break both properties and require a fundamental restructuring of the cost decomposition. The model's parameter values (γ = 0.314 from Almgren 2005, Table 3) are calibrated specifically for the linear form.
lightbulb
Natural extensions. Real-data calibration, intraday volume profiles, multi-asset support, and backtesting against historical fills are the natural next steps for a production TCA system. The Calibration tab in FrontierView demonstrates the parameter estimation methodology on synthetic data with known ground truth, without requiring production data.
engineering

Engineering Notes

Model verification

The model's correctness is verified by a suite of property-based tests asserting mathematical invariants of the Almgren-Chriss framework: schedule-invariance of permanent cost (a consequence of linear permanent impact), monotonicity of the efficient frontier in risk aversion, convergence of the AC linear schedule to TWAP and to instant execution at the limits of risk aversion, and dimensional sanity of the temporary impact denominator.

The schedule-invariance test initially failed, surfacing a discretisation error in the permanent cost path integral ∫₀ᵀ g(v(t)) · (X − x(t))/X dt. The original implementation used a forward (left-Riemann) accumulator: each bin paid the cumulative drift caused by strictly prior bins. This convention does not preserve schedule-invariance at finite bin counts — front-loaded schedules systematically underpaid permanent cost relative to back-loaded ones. The fix was to switch to a midpoint (trapezoidal) accumulator, where each bin pays prior cumulative drift plus half its own — the second-order discretisation of the underlying integral, which restores schedule-invariance to within numerical tolerance.

This is a small story but a representative one: the property test caught a gap between the inline comment ("schedule-invariant by construction") and the actual code behaviour. Comments describe intent; tests verify behaviour.

AC linear schedule — linearisation point

The closed-form Almgren-Chriss solution requires linearising the temporary impact function around a reference participation rate. The implementation linearises at the order's own TWAP participation rate (p₀ = (order_size / horizon) / Vhourly), rather than at a fixed reference such as 10% ADV.

This matters at the extremes. A linearisation around 10% ADV gives a poor approximation for an order operating at 0.1% ADV, because the slope of the 0.6-power-law impact function differs by an order of magnitude between those two regimes. By linearising at the order's own rate, the AC schedule's η̃ slope is calibrated to the participation regime where it actually operates — a small but meaningful improvement in fidelity for the canonical schedule menu.

menu_book

References

The foundational literature behind FrontierView. The Almgren papers are the direct source of the model; the others provide broader microstructure context for why it is constructed as it is.

auto_stories
Almgren & Chriss (2001) Optimal execution of portfolio transactions. Foundational framework establishing the cost–risk trade-off, execution shortfall decomposition, and the concept of the efficient frontier for execution schedules. Journal of Risk · 3(2) · pp. 5–39
auto_stories
Almgren, Thum, Hauptmann & Li (2005) Direct estimation of equity market impact. Empirical extension of the 2001 framework, establishing the power-law exponent ≈ 0.6 for temporary impact. Source of the η and γ coefficients used in FrontierView. Risk · 18(7) · pp. 57–62
auto_stories
Kyle (1985) Continuous auctions and insider trading. Seminal model of informed trading and linear price impact that underpins much of modern microstructure theory. Econometrica · 53(6) · pp. 1315–1335
auto_stories
Huberman & Stanzl (2004) Price manipulation and quasi-arbitrage. Establishes no-arbitrage constraints on the functional form of permanent impact — explaining why permanent impact must be linear in order size. Econometrica · 72(4) · pp. 1247–1275
auto_stories
Gatheral (2010) No-dynamic-arbitrage and market impact. Derives conditions on transient impact models that are consistent with the absence of dynamic arbitrage; extends the Almgren-Chriss framework to more general decay kernels. Quantitative Finance · 10(7) · pp. 749–759
auto_stories
Butz & Oomen (2019) Internalisation by electronic FX spot dealers. Illustrates why the equity market impact framework does not extend to OTC FX and what alternative microstructure model is appropriate for fragmented, dealer-intermediated markets. Quantitative Finance · 19(1) · pp. 35–56