%load_ext autoreload
%autoreload 2
from import_src import *
from collections import OrderedDict
from src.domain.distribution import *
from src.display.portfolio import display_portfolio
from src.data.shares import SHARES_DATA
shares = FundsDistribution(
funds=OrderedDict(
{
"VTI": 0.2,
"GLD": 0.2,
"BND": 0.2,
"SHY": 0.2,
"Russell 2000": 0.2,
}
)
)
display_portfolio(
SharesDistribution(shares=shares), extra_stocks=OrderedDict({"VTI": SHARES_DATA["VTI"], "BND": SHARES_DATA["BND"]})
)
Type | Stock | 60.0% |
---|---|---|
Bond | 40.0% | |
Cap | Large | 66.67% |
Small | 33.33% | |
Term | Long | 50.0% |
Short | 50.0% | |
Region | Us | 100.0% |
Portfolio | |
---|---|
VTI | 20.0% |
GLD | 20.0% |
BND | 20.0% |
SHY | 20.0% |
Russell 2000 | 20.0% |
Mean ret. | Std | Sharpe | | | Portfolio | VTI | BND | |
---|---|---|---|---|---|---|---|
Portfolio | 7.55% | 7.51% | 1.01 | | | - | 85.5% | 23.98% |
VTI | 10.98% | 15.55% | 0.71 | | | 85.5% | - | 16.64% |
BND | 6.72% | 5.3% | 1.27 | | | 23.98% | 16.64% | - |
from collections import OrderedDict
from src.display.portfolio import display_portfolio
from src.data.shares import SHARES_DATA
shares = FundsDistribution(
funds=OrderedDict(
{
"VTI": 0.3,
"BND": 0.4,
"SHY": 0.15,
"GLD": 0.075,
"DBC": 0.075,
}
)
)
display_portfolio(
SharesDistribution(shares=shares), extra_stocks=OrderedDict({"VTI": SHARES_DATA["VTI"], "BND": SHARES_DATA["BND"]})
)
Type | Stock | 45.0% |
---|---|---|
Bond | 55.0% | |
Cap | Large | 100.0% |
Term | Long | 72.73% |
Short | 27.27% | |
Region | Us | 100.0% |
Portfolio | |
---|---|
VTI | 30.0% |
BND | 40.0% |
SHY | 15.0% |
GLD | 7.5% |
DBC | 7.5% |
Mean ret. | Std | Sharpe | | | Portfolio | VTI | BND | |
---|---|---|---|---|---|---|---|
Portfolio | 6.84% | 6.35% | 1.08 | | | - | 86.96% | 39.19% |
VTI | 10.98% | 15.55% | 0.71 | | | 86.96% | - | 16.64% |
BND | 6.72% | 5.3% | 1.27 | | | 39.19% | 16.64% | - |