Releases: mbk-dev/okama
Okama 1.2.1
New features:
get_tangency_portfolio()can calculate tangency portfolio weights for CAGR (rate of return with geometric mean).
Fix:
- base currency
first_dateandlast_datewere calculated wrong in AssetList, Portfolio and EfficientFrontier
Okama 1.2.0
New Macroeconomic class Indicator
3 macroeconomic classes are available (and Documented):
Indicator: Macroeconomic indicators and ratios. (.RATIONEW namespace)Inflation: Inflation related data and methods (.INFLnamespace)Rates: Rates of central banks and banks (.RATEnamesapce)
Cyclically adjusted price-to-earnings ratios (CAPE10) for 20+ countries are in the DataBase: USA_CAPE10.RATIO, CHN_CAPE10.RATIO, CHN_CAPE10.RATIO etc.
Daily value time series for Macro classes
Rate class has .values_daily property which can be used with bak raters and some other symbols:
ok.Rate("RUONIA.RATE").values_daily
all Macro classes have .values_monthly property.
.describe() methods in all macroeconomic classes
.describe() methods show descriptive statistics for YTD and given periods:
- arithmetic mean
- median
- max and min values
Inflation class .describe() method is different. It generates inflation-specific statistics:
- YTD compound inflation
- Annual inflation (geometric mean) for a given list of periods
- max 12 months inflation for the periods
- Annual inflation (geometric mean) for the whole history
Rolling tracking difference for stock indexes and ETFs
.tracking_difference() and tracking_difference_annualized() in AssetList class are now methods (where properties). Methods have rolling_window attribute to set wolling window size (in months).
To calclulate 24 months movig tracking difference:
x.tracking_difference(rolling_window=24)
Full Changelog: v1.1.6...v1.2.0
Okama 1.1.6
Introduce parallel computing for heavy calculations in multi-period portfolio optimization (Efficient Frontier).
Minor changes:
- okama uses
blackfor code formatting - development dependencies use Python 3.7 to stay compatible with Google Colab
Okama 1.1.5
Use new financial API (api.okama.io) for historical data requests.
Okama 1.1.4
Replace deprecated .append with .concat for new versions of panda package.
Okama 1.1.3
Add poetry as a dependency manager.
Okama 1.1.2
Sortino ratio and Diversification ratios:
get_sortiono_ratio()method is available in AssetList and Portfoliodiversification_ratioproperty is added to Portfolioget_most_diversified_portfolio()method is added to EfficientFrontiermdp_pointsproperty is added to EfficientFrontier
mdp_points is a DataFrame with the Most diversified portfolios points.
More examples in Jupyter Notebooks:
- 08 financial database.ipynb has financial database queries examples
Okama 1.1.1
New method in AssetList:
.tracking_difference_annualto calculate tracking difference for each calendar year. See details in Documentation.
Fixed:
- if the asset historical data period is too short there is an ValuError in initialization
Full Changelog: v1.1.0...v1.1.1
Okama 1.1.0
Sharpe Ratio, Tangency portfolio and Capital Market Line (CML):
.get_sharpe_ratio()method is available in Portfolio and AssetList.get_tangency_portfolio()method in EfficientFrontier to optimize allocation with Sharpe Ratio as objective function.plot_cml()method in EfficientFrontier to plot the Capital Market Line (CML) and Maximum Sharpe Ratio (MSR) point with the Efficient Frontier
Refactoring:
.plot_assets()method is at ListMaker abstract class and is available from: AssetList, Portfolio, EfficientFrontier and EfficientFrontierReb.plot_pair_ef()method is at EfficientFrontier.plot_transition_map()is at EfficientFrontierPlotsclass discontinued
Okama 1.0.2
Database Search improvements:
ok.search()accepts namespace as an argumentok.search()andok.symbols_in_namespace()return DataFrame (default) or json. It can be changed withresponse_formatargument ('frame' or 'json')
Bugs fixed:
- limit
.inflation_tsby 'first_date' and 'last_date' in Portfolio and AssetList - np.nan and np.inf are replaced with 0 in
AssetList.get_dividend_mean_grow()