miaolay 投资组合再平衡器Portfolio Rebalancer

最近更新last touched · 2026-08-18使用made with · JavaScript / calculation / local storage状态state · living

Tool 05 / allocation · local-first

投资组合再平衡器Portfolio Rebalancer

See what is actually out of balance, decide whether it deserves a trade, and compare the cost of precision with the cost of doing nothing.

state · living made with · JavaScript quotes · manual until refreshed storage · this browser
Portfolio now

What you own

Portfolio value
base currency · USD
Invested
Cash
Portfolio drift
½ Σ |当前 − 目标|½ Σ |current − target|
Largest position
Inputs

Holdings & targets

Targets may be exact or bands. A band lets a position drift without creating pointless trades.

target · —

This workspace starts empty. Add an asset or load the clearly marked demo; nothing shown here is a published miaolay holding.

Asset Name 类型Type Class Qty Price CCY Cost Value Weight Target Band min Band max Drift Lock
manual values
Cost is optional cost per share. It is used only to estimate embedded gain on proposed sells; this page does not calculate tax liability.
Structure

Current vs target

The dark bar is current weight. The thin line is the target. Positions inside their allowed band can be left alone.

当前Currenttarget
Drift map
Decision

Rebalance only as much as needed

Exactness is optional. Lock positions, protect cash, ignore tiny trades, or use new contributions to dilute an overweight position naturally.

Recommended trades
After
Drift
Trades
Cash left
Estimated realized gain
rough, before tax
No calculation yet.
Trade-off

Rebalance frontier

How much allocation accuracy does each additional trade buy? The highlighted row is the first point that reaches your drift tolerance.

Trades vs remaining drift
Practical point
This is not an optimizer of expected return. It only measures how much target-allocation error remains after taking the largest mechanical rebalance actions first.
No-sell path

Can time fix the overweight?

For a position you do not want to sell, calculate the new capital required to dilute it to a target weight while its price stays unchanged.

NEW CAPITAL REQUIRED
This isolates dilution only. Market movement will change the result.
Future cash flow

Contribution routing

Project how recurring contributions can repair drift without selling. Prices are held constant so the result isolates the effect of cash flow.

Each month, investable cash is routed toward the largest target-value gaps. Positions are never sold in this simulation.
Projected drift
Inside all bands
first projected month
Cash after horizon
NEXT CONTRIBUTION ROUTING
Risk

Concentration you can explain

No black-box score. Each number has a direct interpretation and can be reproduced from the weights above.

Top 3 concentration
share of total portfolio
HHI
Σ weight², incl. cash
Effective positions
1 / HHI
Largest −50%
direct portfolio impact
Class risk budget
Budget readout
Class ceilings are user-defined policy limits, not statistically estimated risk. They are useful when your investment rule is expressed as “growth + speculative must stay below X%.”
Stress assumptions
Scenario result
CONTRIBUTION BY CLASS
Data

Live data is optional

A quote is an input, not a recommendation. Manual prices remain first-class so the calculator still works when every API is unavailable.

Finnhub

free key

Primary option for US equity quotes. User key stays in this browser.

Twelve Data

free key

Fallback for equities and ETFs; useful when you want broader symbol coverage.

Alpha Vantage

free key · EOD fallback

Low-frequency fallback. Free GLOBAL_QUOTE should not be presented as live US pricing.

Frankfurter

no key

FX conversion. Open CORS, no daily/monthly quota, reference rates rather than trading quotes.

CoinGecko

演示密钥Demo key

Optional crypto quotes. Common symbols are mapped locally to CoinGecko IDs.

手动Manual

always available

Never block calculation because a provider is down, rate-limited, or missing a symbol.

边界Boundary

A calculator is not a portfolio manager

Holdings, targets, API keys, and saved states are kept in this browser. Quote requests go directly from your browser to the provider you enable. The page can calculate allocation, drift, concentration, mechanical rebalancing, and simple shocks. It cannot know your tax jurisdiction, liquidity needs, execution quality, future returns, or whether a target allocation is appropriate.

local-first