Portfolio Optimization
Structure of Optimizer
- Risk Model
- Shrinkage estimator of the covariance matrix of stock returns
- Transaction Cost Model
- 1bp+12bid-ask spread
- Alpha
- Weighted blend of various standardized, winsorized alphas
Input
- position as of close of business on day t−1
- alphas using data observed up to day t−1
- transaction costs using data observed up to day t−1
- risk model using data observed up to day t−1
- constraints using data observed up to day t−1
Objectives & Constraints
- Minimize risk: x′Σx
- Maximize exposure to alpha: α′x
- Neutralize exposure to beta: β′x=0
- Minimize transaction costs: τ′|x−w|
- Other constraints:
- maximum trade size
- maximum position size
- maximum industry and country exposure
- Notations
Variable | Dimension | Definition |
---|---|---|
x | n×1 | desired portfolio weights |
w | n×1 | initial portfolio weights |
Σ | n×n | covariance matrix of stock returns |
α | n×1 | aggregate alphas |
β | n×1 | historical betas |
τ | n×1 | transaction costs |
The parametric problems formed as:
maxxα′x−λτ′|x−w|−μx′Σxsubject to:
- beta neutrality: β′x=0
- max trade and position: γ≤x≤δ
- Max trade size for ith stock: θi
- ⇒wi−θi≤xi≤wi+θi
- Max position size for ith stock: \pi_i
- ⇒−πi≤xi≤πi
- Max trade size for ith stock: θi
- industry constraint: −r∗⋅1≤R′x≤r∗⋅1
- Sectors are a factor of risk
- Difficult to time sector performance
- Constrain industry exposure
- But not to zero (will incur transaction cost)
- r∗=$300,000 limit for $50×50M book size
- Industry Dummy
- ρ industries
- Boolean matrix R of dimension n×ρ
- R(i,j)=1 if ith stock belongs to jth industry else 0
- Every row of matrix R has exactly one entry equal to 1; all other entries are equal to 0
- country constraint: −f∗⋅1≤F′x≤f∗⋅1
- Countries are a factor of risk
- Difficult to time country performance
- Constrain country exposure
- But not to zero (will incur too much transaction cost)
- f∗=$100,000 limit for $50×50M book size
- Industry Dummy
- φ industries
- Boolean matrix F of dimension n×φ
- F(i,j)=1 if ith stock belongs to jth industry else 0
- Every row of matrix F has exactly one entry equal to 1; all other entries are equal to 0
Output
trade to be executed on day t
Final position(t+1)=Final position(t)+trade(t)Backtest Process
- Load all necessary data into memory
- Create the alphas
- Start from portfolio with zero dollar invested
- Loop over all days in backtest period
- Every day: call optimizer to find optimal rebalancing trade given initial position
- End-of-day position becomes initial position of next day
- Compute P&L