Portfolio¶
Presets, characteristics, and glide paths.
Allocation here is asset-class only β stocks, bonds, cash, crypto, real estate, other. No parameter or return field in any of these tools names a ticker, fund, or security. These tools model the impact of an allocation on your projection; they don't recommend one.
create_portfolio_assumptions¶
Create portfolio capital market assumptions.
| Parameter | Type | Default | Description |
|---|---|---|---|
preset |
string | "standard" |
Preset to use: 'standard', 'conservative', or 'optimistic' |
stocks_return |
float | null | Override stock expected annual return (e.g., 0.07 = 7%) |
stocks_volatility |
float | null | Override stock annual volatility (e.g., 0.15 = 15%) |
bonds_return |
float | null | Override bond expected annual return (e.g., 0.04 = 4%) |
bonds_volatility |
float | null | Override bond annual volatility (e.g., 0.06 = 6%) |
cash_return |
float | null | Override cash expected annual return (e.g., 0.02 = 2%) |
cash_volatility |
float | null | Override cash annual volatility (e.g., 0.01 = 1%) |
crypto_return |
float | null | Override crypto expected annual return (e.g., 0.02 = 2%) |
crypto_volatility |
float | null | Override crypto annual volatility (e.g., 0.18 = 18%) |
real_estate_return |
float | null | Override real estate expected annual return (e.g., 0.02 = 2%) |
real_estate_volatility |
float | null | Override real estate annual volatility (e.g., 0.06 = 6%) |
other_return |
float | null | Override other-asset expected annual return (e.g., 0.02 = 2%) |
other_volatility |
float | null | Override other-asset annual volatility (e.g., 0.06 = 6%) |
Returns: base_preset, and assumptions.
calculate_portfolio_characteristics¶
Calculate expected return and volatility for a portfolio allocation.
| Parameter | Type | Default | Description |
|---|---|---|---|
stocks_pct |
int | required | Stock allocation percentage (0-100) |
bonds_pct |
int | required | Bond allocation percentage (0-100) |
cash_pct |
int | required | Cash allocation percentage (0-100) |
crypto_pct |
int | 0 |
Crypto allocation % (0-100) |
real_estate_pct |
int | 0 |
Real estate allocation % (0-100) |
other_pct |
int | 0 |
Other-asset allocation % (0-100) |
assumption_preset |
string | "standard" |
Assumptions preset: 'standard', 'conservative', or 'optimistic' |
stocks_return |
float | null | Override stock expected return (e.g., 0.07 = 7%) |
stocks_volatility |
float | null | Override stock volatility (e.g., 0.15 = 15%) |
bonds_return |
float | null | Override bond expected return (e.g., 0.04 = 4%) |
bonds_volatility |
float | null | Override bond volatility (e.g., 0.06 = 6%) |
cash_return |
float | null | Override cash expected return (e.g., 0.02 = 2%) |
cash_volatility |
float | null | Override cash volatility (e.g., 0.01 = 1%) |
crypto_return |
float | null | Override crypto expected return (e.g., 0.02 = 2%) |
crypto_volatility |
float | null | Override crypto volatility (e.g., 0.18 = 18%) |
real_estate_return |
float | null | Override real estate expected return (e.g., 0.02 = 2%) |
real_estate_volatility |
float | null | Override real estate volatility (e.g., 0.06 = 6%) |
other_return |
float | null | Override other-asset expected return (e.g., 0.02 = 2%) |
other_volatility |
float | null | Override other-asset volatility (e.g., 0.06 = 6%) |
Returns expected annual return and volatility for the portfolio.
calculate_portfolio_characteristics_batch¶
Compute expected return + volatility for many allocations in one call.
| Parameter | Type | Default | Description |
|---|---|---|---|
allocations |
list | required | List of portfolio allocations to evaluate in one call. Each entry is a calculate_portfolio_characteristics parameter object β at minimum {stocks_pct, bonds_pct, cash_pct} (summing to 100 with any crypto_pct/real_estate_pct/other_pct), plus optional assumption_preset and per-asset return/volatility overrides (stocks_return, stocks_volatility, ...). |
Returns: count, succeeded, failed, and allocations.
generate_glide_path¶
Generate a glide path transitioning between two allocations over time.
| Parameter | Type | Default | Description |
|---|---|---|---|
start_stocks_pct |
int | required | Starting stock allocation (0-100). When age_based=True, this is the young/pre-glide allocation. |
start_bonds_pct |
int | required | Starting bond allocation (0-100). When age_based=True, this is the young/pre-glide allocation. |
start_cash_pct |
int | required | Starting cash allocation (0-100). When age_based=True, this is the young/pre-glide allocation. |
end_stocks_pct |
int | required | Ending stock allocation (0-100). When age_based=True, this is the retirement allocation. |
end_bonds_pct |
int | required | Ending bond allocation (0-100). When age_based=True, this is the retirement allocation. |
end_cash_pct |
int | required | Ending cash allocation (0-100). When age_based=True, this is the retirement allocation. |
start_crypto_pct |
int | 0 |
Starting crypto allocation (0-100). When age_based=True, this is the young/pre-glide allocation. |
start_real_estate_pct |
int | 0 |
Starting real estate allocation (0-100). When age_based=True, this is the young/pre-glide allocation. |
start_other_pct |
int | 0 |
Starting other-asset allocation (0-100). When age_based=True, this is the young/pre-glide allocation. |
end_crypto_pct |
int | 0 |
Ending crypto allocation (0-100). When age_based=True, this is the retirement allocation. |
end_real_estate_pct |
int | 0 |
Ending real estate allocation (0-100). When age_based=True, this is the retirement allocation. |
end_other_pct |
int | 0 |
Ending other-asset allocation (0-100). When age_based=True, this is the retirement allocation. |
num_years |
int | 30 |
Number of years for the glide path (ignored when age_based=True) |
sample_interval_years |
int | 5 |
Show allocation every N years (default: 5) |
age_based |
bool | false |
If True, use age-based 3-phase glide path instead of linear transition |
current_age |
int | null | Person's current age (required if age_based=True) |
death_age |
int | null | Assumed age at death (default: 95, used if age_based=True) |
retirement_age |
int | null | Retirement age (default: 67, used if age_based=True) |
glide_start_age |
int | null | Age when allocation starts shifting (default: 47, used if age_based=True) |
Returns the allocation timeline with samples at regular intervals.