Direct Answer
A constrained weight optimizer computes the portfolio weights that maximize the Sharpe ratio or minimize variance across up to six assets while respecting the minimum and maximum weight bounds you set for each position. It uses the expected returns, volatilities, and correlations you enter to solve for the optimal allocation subject to those constraints, then displays the resulting weights and portfolio statistics. This tool runs entirely in your browser for illustrative planning, not investment advice.
Constrained Weight Optimizer
Enter expected returns, volatilities, and correlations for up to 6 assets, then set minimum and maximum weight bounds for each. Choose to maximize the Sharpe ratio or minimize portfolio variance. The optimizer computes and displays the constrained optimal weights, portfolio statistics, and a breakdown by asset.
Tool Inputs
Optimal Portfolio
Click "Compute Optimal Weights" to see results.
Comparison: Constrained vs. Unconstrained
Results will appear here after computing.
How Constraints Work
- Minimum weight: Forces at least this fraction of the portfolio to be allocated to the asset, even if the unconstrained optimizer would exclude it. Use when diversification minimums or policy allocations require a floor.
- Maximum weight: Caps the optimizer from concentrating too much in a single asset. A 30% cap, for example, prevents the optimization from placing 70% in a single asset with a high Sharpe ratio when its expected return estimate may be unreliable.
- Feasibility: Constraints are feasible when the sum of all minimums ≤ 1 and the sum of all maximums ≥ 1. If constraints are infeasible (e.g., min weights sum to more than 100%), the tool will report an error.
- Constrained vs. unconstrained: Adding constraints can never improve the optimal value of the chosen objective and often worsens it: the maximum Sharpe ratio stays the same or falls, and the minimum variance stays the same or rises. The comparison section shows how much performance is "given up" to satisfy constraints.
References
- Markowitz, H. (1952). "Portfolio Selection." The Journal of Finance, 7(1), 77-91, the foundational mean-variance optimization paper this tool's Sharpe-ratio and minimum-variance objectives are built on.
- CFA Institute Research and Policy Center
- SEC Investor.gov: Asset Allocation and Diversification
Educational Disclaimer
This tool is for educational and illustrative purposes only. Optimization outputs are highly sensitive to expected return assumptions, which are inherently uncertain. The optimizer uses projected gradient descent on the box-constrained simplex, a numerical method that stops after a fixed number of steps, so results are approximations rather than exact solutions. This tool does not constitute investment advice.