Trading Dev AcademyFree quant education

Free lesson · Optimization

Exposure constraints before optimization

Open interactive lessonPractice calculationsExplore labs

Start with the idea

A target portfolio is useful only if it fits the mandate and the available capital.

Symbols, units & horizon
  • w_i: signed notional of asset i divided by current equity, dimensionless at rebalance time
  • N: net exposure fraction
  • G: gross exposure fraction
  • i: asset index

When and why to use this

Use this report at pre-trade checks and after rounding or partial fills.

A target portfolio is useful only if it fits the mandate and the available capital.

Net exposure adds signed positions; gross exposure adds their magnitudes. A long/short book can have little net exposure while still requiring substantial financing and collateral. A position cap, gross cap and dollar-neutral constraint are different restrictions.

Check final rounded positions after any adjustment. Clipping each position independently can break neutrality. Build an explicit feasibility report before comparing expected utility.

N=∑iwi,G=∑i|wi|
Exposure accounting identities

Exposure constraints before optimization

  1. Divide each signed notional by the same equity base.
  2. Add signed weights for net exposure.
  3. Take each absolute weight before adding for gross exposure; compare each result to its own limit.
Work it by hand

Weights .6, −.4 and .2 give net .4 and gross 1.2. A gross limit of 1.0 is breached despite only .4 net exposure.

Apply it in a strategy

  • Freeze inputs at the stated decision time and record their units.
  • Use this report at pre-trade checks and after rounding or partial fills.
  • Recompute the example, then change the material assumption and explain the difference.

Research deliverable

Exposure constraints before optimization: produce the worked calculation, a timestamped input record and a written decision addressing this limitation: A low net exposure does not bound factor, liquidity or funding risk.

These are synthetic mechanics examples, not historical performance or paper replications. Module evidence and research boundaries record the 12 September 2026 review.

Research sources, review dates and limitations

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

# Python 3.10+; standard library and NumPy only.
# Synthetic teaching inputs; conventions and units are defined in the notation above.
import numpy as np

def exposures(weights):
    w=np.asarray(weights,dtype=float)
    if w.ndim!=1 or not np.isfinite(w).all(): raise ValueError('Finite weight vector required')
    return float(w.sum()),float(np.abs(w).sum())

assert np.allclose(exposures([.6,-.4,.2]),[.4,1.2])
print(exposures([.6,-.4,.2]))

Continue learning

Optimization: Feasibility, Costs & Robust Decisions — all lessons
  1. Exposure constraints before optimization
  2. Curvature and a bounded quadratic decision
  3. Derive the fully invested minimum-variance portfolio
  4. Project a desired allocation onto the long-only simplex
  5. Trading costs and a no-trade decision
  6. An uncertainty bound becomes a position penalty
  7. Read a binding constraint through its shadow price
  8. Numerical residuals and independent solution checks

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations