Create a Portfolio from one of the classic portfolios, by its identifier, name or alias (see Portfolio.get_presets), e.g. “60/40”, “All Weather”, “Permanent”, “Golden Butterfly” or “Three Fund”. It invests initial_value on start_date and rebalances as the definition says, after which every Portfolio and Toolkit analysis applies.

From a Classic Portfolio in Python

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call from_preset as shown below.

from financetoolkit import Portfolio

portfolio = Portfolio.from_preset(
    "Permanent Portfolio",
    start_date="2016-01-01",
    api_key="FINANCIAL_MODELING_PREP_KEY",
)

portfolio.get_portfolio_overview()

Parameters

from_preset accepts the following parameters.

ParameterTypeDescriptionExample
namestrThe identifier, name or alias of the preset. **kwargs: The other arguments of Portfolio, such as api_key, start_date, initial_value, rebalancing and benchmark_ticker.
Share