Free lesson · Putting it all together
6 / Convert forecasts into constrained portfolio positions
Open interactive lessonPractice calculationsExplore labs
Start with the idea
A signal estimates an opportunity; sizing decides how much risk and cash to assign to it. Translate a return forecast into a bounded exposure before turning it into share counts.
Symbols, units & horizon
- σ_target: target daily account volatility as a decimal
- σ̂: positive estimated daily asset volatility
- w_max: maximum long-only weight
- E: current account equity in dollars
- P_ref: reference dollars per share
- floor brackets: round down to whole shares
- q_target: target holdings, not order quantity
When and why to use this
Use constrained sizing to connect forecast outputs to the risk mandate and the order-generation layer.
For a simple one-asset risk budget, dividing target account volatility by asset volatility gives a tentative weight, assuming cash is riskless and the estimate is applicable. Cap that weight at the mandate limit. This is a scale estimate, not a guaranteed loss bound.
In the running example, target daily account volatility .5% and estimated asset daily volatility 2% give weight .25, exactly the 25% cap. With equity $10,000 and reference price $100, the target is 25 shares. Keep cash for costs and respect lot-size rounding.
When adding assets, separate gross, net, factor and currency exposure. Correlated positions can violate the intended risk budget even when every individual weight looks small. Use the covariance and portfolio-allocation lessons to check joint risk.
Every final position must be checked after rounding, clipping, fills and price changes. A hedge that is neutral before independent rounding may no longer be neutral afterward. Allow the allocator to select zero exposure when expected reward does not cover costs or data quality is inadequate.
6 / Convert forecasts into constrained portfolio positions
- Ensure target and asset volatility use the same horizon and return units.
- Divide target by estimated asset volatility, then cap by w_max.
- Multiply equity by weight and divide by reference price. Round down to a valid lot; reserve actual cash for fees separately.
σ_target=.005, σ̂=.02 and cap=.25 yield w=.25. E=$10,000 and P_ref=$100 give floor(2500/100)=25 target shares. If volatility doubles, the same rule lowers weight to .125.
Apply it in a strategy
- Match forecast and risk horizons and define a cash reserve.
- Apply joint portfolio constraints before orders.
- Recheck realized holdings and exposures after fills and lot rounding.
Research deliverable
Turn the running forecast into a target-position record with units, limits and rejection reasons.
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.
from math import floor
def risk_target(equity,reference,volatility,target=.005,cap=.25):
if min(equity,reference,volatility)<=0 or target<0 or not 0<=cap<=1: raise ValueError("Invalid risk inputs")
weight=min(cap,target/volatility)
return weight,floor(equity*weight/reference)
print(risk_target(10000,100,.02))Continue learning
Putting It All Together: Build a Complete Trading Research System — all lessons- 1 / Define the job and a small research contract
- 2 / Make a point-in-time data contract
- 3 / Turn an idea into a causal feature and a baseline
- 4 / Replay decisions into fills and net returns
- 5 / Add ML, regime models or RL only at a defined interface
- 6 / Convert forecasts into constrained portfolio positions
- 7 / Turn targets into idempotent orders and handle partial fills
- 8 / Reconcile fills, costs, cash and performance
- 9 / Run the miniature system and define the promotion decision
Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations