Repository navigation
This release makes point in time strict (FinancialModelingPrep filing dates only, FRED's first releases for US macro data) and gives everything in an investor's currency with Toolkit(currency=...). It adds valuation models (implied cost of capital variants, the adjusted present value, an FCFE DCF, a Fama-French cost of equity and a bottom-up beta), econometric tests and cycle filters, macro rules (the Sahm rule, Taylor rules, the yield curve recession probability, Excess CAPE Yield and government debt dynamics), the Federal Reserve Board's yield curves and term premium, central bank balance sheets and US net liquidity, financial conditions, stress and uncertainty indices, systemic risk measures and return signals, congressional trades, major and fund holders, exchange hours and holidays, and the net positions of the Commitment of Traders report.
Package
Currency
Toolkit(currency="EUR")gives everything in money in that currency: historical data at each day's exchange rate (pence divided by 100, returns calculated again from the converted prices), the financial statements at the fiscal closing rate (balance sheet) and the fiscal-period average rate (income and cash flow statement), and profiles, quotes, price targets and analyst estimates at the latest rate. The ratios, models, technicals, performance, risk, portfolio, ETF and econometrics modules therefore calculate in that currency, so a portfolio listed in several currencies can be compared and added up. Rates and yields, factor returns, Economics, Fixed Income, option chains and intraday data stay as published. Thanks to @Shilla-Wealth for the idea and the first version. (#721, #730)- The forward P/E of a company listed in another currency than it reports in divides the price by analyst estimates converted to the currency of the price, as the statements already were: ULVR.L gives 19.63 instead of 1743.38 (pence over euros). (#730)
- With a currency, the Options module calculates on the prices as listed, so its strikes, option prices and Greeks are those of the contracts in its option chains, and the exchange rates of the statements start at the earliest fiscal period, so a fiscal year that ends before the lookback start date (Apple's) is no longer empty in the currency. (#756)
Point in time
Toolkit(point_in_time=True)uses only the Accepted Date or Filing Date FinancialModelingPrep reports, with no reporting-deadline estimates. Tickers without them (Yahoo Finance data, supplied statements, companies whose filings carry no usable date) are left out of the statements and everything calculated from them, which is logged once; periods without a filing date stay empty. (#738)- With
point_in_time=True, analyst estimates count only for an end date in the last 7 days, and only for the fiscal periods after the last one filed:get_analyst_estimates, the forward P/E and PEG,get_implied_cost_of_capital,get_frankel_lee_valueandget_analyst_forecast_dispersionleave every earlier period empty, and with an earlier end date they are empty. Without it, their Notes say that historical periods use today's estimates. (#738) Economics(point_in_time=True), whichToolkit(point_in_time=True)passes on, gives the US series of FRED as they were first published (FRED's real-time archive, ALFRED), indexed by the day each was published, so a backtest or a regression on prices only sees what was public. It covers 21 methods: CPI and inflation, producer, export and import prices, payrolls, jobless claims, the job vacancy rate, retail sales, industrial production, housing starts, real personal income, the recession indicator, the Chicago Fed indices, GDPNow, the 30-year mortgage rate, commercial real estate prices and the yield curve recession probability. Growth and windows are calculated on the first releases. Every other method and country is left out with a warning rather than answered with revised data. (#740)get_bottom_up_betauses the industry betas Damodaran published in January of each period's year, from his archive, instead of this year's betas for every period. A year without an archive file, or whose file does not hold the industry, is NaN. (#740)
Market data
- A ticker no source has statements for gives empty statements instead of recursing until Python's limit. (#742)
- Prices of a London, Johannesburg or Tel Aviv listing from Yahoo Finance are in the currency it is quoted in (GBp, ZAc, ILA), as its Currency says, with
yfinance>=1.6; prices an older yfinance stored in pounds, rand or shekels are fetched again. (#739) get_congressional_tradesgives the trades members of the US Senate and House disclosed under the STOCK Act per ticker (chamber="senate", "house" or "both"), with the disclosed amount range and its bounds inAmount LowandAmount High. (#731)get_beneficial_ownershipgives the Schedule 13D and 13G filings of investors owning more than 5% of a company: shares owned, voting and dispositive power and the percentage of the class (a decimal). (#731)get_mutual_fund_holdersgives the mutual funds holding each ticker from their latest N-PORT disclosure, with the change in shares and the weight in the fund (a decimal). (#731)get_analyst_consensusgives today's strong buy, buy, hold, sell and strong sell counts with the number of analysts, the buy share, the mean recommendation (1 to 5) and the consensus. (#731)get_esg_ratingsgives the ESG risk rating (a letter), the industry and the industry rank per fiscal year. (#731)get_commitment_of_tradersgives each trader group's net position (Non-Commercial Net,Commercial Net,Non-Reportable Net) and the speculators' and hedgers' nets as a share of open interest. The% OIshares of open interest are decimals (0.515 for 51.5%), like every other ratio in the package. (#719)
Risk and performance
- Every Performance and Risk measure calculated over a sample of returns takes
rolling=as the Sharpe and Sortino ratios do: the Calmar, Sterling, Burke, Pain, Kappa, STARR, Rachev, d, Prospect and Gain-to-Pain ratios, the Win Rate, stability of returns, Variability-Weighted Return, risk measure ratio and Serenity Index, and the Pain and Ulcer Index, Mean Absolute Deviation, Coefficient of Variation, drawdown duration and recovery time and Amihud illiquidity give the measure over every window ofrollingreturns, each ticker on its own trading days. (#744) get_absorption_ratiogives the Absorption Ratio of Kritzman, Li, Page and Rigobon (2011) for the Toolkit's tickers as one set: the share of their variance explained by the largest eigenvectors (500-day covariance with a 250-day half-life), and its standardized shift, the early warning signal. (#732)get_financial_turbulencegives the Financial Turbulence of Kritzman and Li (2010) for the tickers as one set, the Mahalanobis distance of the day's returns from their history, split into Kinlaw and Turkington's (2014) Magnitude Surprise and Correlation Surprise. (#732)get_maximum_daily_returngives MAX, the largest daily return of each month (or the average of thetoplargest), the lottery-demand measure of Bali, Cakici and Whitelaw (2011). (#732)get_52_week_high_ratiogives the price as a fraction of its 52-week high, the anchoring momentum signal of George and Hwang (2004). (#732)get_information_discretenessgives the frog-in-the-pan Information Discreteness of Da, Gurun and Warachka (2014): whether a ticker's momentum came in many small moves or a few large ones. (#732)get_time_series_momentumgives the Time Series Momentum position of Moskowitz, Ooi and Pedersen (2012): the sign of the 12-month excess return, scaled to a 40% target volatility. (#732)get_residual_momentumgives the Residual Momentum of Blitz, Huij and Martens (2011): the standardized momentum of the residuals from a 36-month Fama-French three-factor regression, withregion=for the regional factors. (#732)get_beta(method="frazzini_pedersen")gives the Beta of Frazzini and Pedersen's (2014) betting-against-beta factor: the 5-year correlation of 3-day overlapping returns times the ratio of the 1-year volatilities, shrunk 0.6/0.4 towards 1. (#732)get_momentum(method=...)gives the momentum and reversal family from the monthly returns: 12-2 and 6-2 momentum (Jegadeesh and Titman 1993), intermediate momentum (Novy-Marx 2012), the short, medium and long-term reversals (Jegadeesh 1990; De Bondt and Thaler 1985) and the seasonal and off-season returns of Heston and Sadka (2008). (#754)get_price_impact(method=...)adds Pastor and Stambaugh's (2003) return reversal, the Amivest ratio, return-to-turnover (Florackis, Gregoriou and Kostakis 2011), Kyle and Obizhaeva's (2016) invariance measure and the Martin (1975) and Hui-Heubel (1984) ratios.get_bid_ask_spread(method="fong_holden_trzcinka")gives the FHT spread (2017),get_amihud_illiquiditythe ratio over up or down days (Brennan, Huh and Subrahmanyam 2013) andget_share_turnoverits variability (Chordia, Subrahmanyam and Anshuman 2001). (#758)get_zero_trading_daysgives the share of zero-return (Lesmond, Ogden and Trzcinka 1999) or zero-volume days and Liu's (2006) LM measure, andget_price_delaythe D1, D2 and D3 price delay of Hou and Moskowitz (2005). (#758)get_upside_potential_ratio(upside_order=, downside_order=)gives the ratio of Farinelli and Tibiletti (2008), of which the Upside Potential Ratio is the default orders,get_beta(method="fama")Fama's (1972) total risk beta,get_hill_estimator(method="pickands"/"moment")Pickands' (1975) and the Dekkers-Einmahl-de Haan (1989) estimators of the tail shape, andget_value_at_risk(method="expectile")the expectile VaR (Newey and Powell 1987; Bellini, Klar, Müller and Rosazza Gianin 2014). (#760)get_value_at_risk(method="filtered_historic")andget_conditional_value_at_risk(method="filtered_historic")give the filtered historical simulation of Barone-Adesi, Giannopoulos and Vosper (1999) and Hull and White (1998): the empirical tail of the GARCH-standardized returns scaled to the next period's volatility, also rolling. (#765)get_fama_and_french_model(model="q")andmodel="q5"run the factor model on the q-factors of Hou, Xue and Zhang (2015), market, size, investment and return on equity, and on the q5 model of Hou, Mo, Xue and Zhang (2021), which adds expected growth, from global-q.org;get_idiosyncratic_volatilitytakes the same models. (#766)get_liquidity_betagives the Liquidity Beta of Pastor and Stambaugh (2003): the exposure of the monthly excess return to the innovations in aggregate US market liquidity (or the traded liquidity factor withfactor="traded") beside the market, size and value factors, over 60 months, from Lubos Pastor's published factors. (#766)get_intermediary_betagives the broker-dealer leverage beta of Adrian, Etula and Muir (2014): the exposure of the quarterly excess return to the seasonally adjusted log change in the leverage of US broker-dealers, from the Federal Reserve's Financial Accounts, over 40 quarters. (#766)get_idiosyncratic_skewnessgives the skewness of the daily residuals of a CAPM, Fama-French three-factor or q-factor regression per month, the lottery-demand measure of Bali, Engle and Murray (2016). (#766)
ETF and Discovery
etf.get_holdersis the reverse ofget_holdings: the ETFs and funds that hold each ticker, the most shares first, with the ticker's weight in each fund (a decimal). (#731)get_congressional_trades_latestlists the latest trades disclosed by members of Congress,get_exchange_market_hoursgives every exchange's trading hours and whether it is open now,get_exchange_holidaysgives an exchange's closed and shortened days, andget_esg_benchmarkgives the average ESG scores per sector. (#731)
Models and ratios
-
get_implied_cost_of_capital(method=...)gives the implied cost of capital of Gebhardt, Lee and Swaminathan (2001), Claus and Thomas (2001), Ohlson and Juettner-Nauroth (2005) and the Gordon model (EPS1 / P) next to Easton (2004), and"average", their mean per period.methodis now the first parameter, somodifiedis passed by name. (#733) -
get_frankel_lee_valuegives the residual income value of Frankel and Lee (1998) from three years of consensus EPS, with its value to price ratio. (#733) -
get_equity_durationgives the equity duration of Dechow, Sloan and Soliman (2004): ROE and sales growth fade to their long-run levels over 10 years, with the rest as a perpetuity. (#733) -
get_analyst_forecast_dispersiongives the range of the analysts' EPS, revenue or EBITDA estimates scaled by their mean, (high − low) / |mean|, per estimate period. (#733, #752) -
get_analyst_growth_forecastgives the EPS growth the consensus implies for the next fiscal year and per year to the furthest year enough analysts cover, and the disparity between them (La Porta 1996; Da and Warachka 2011).get_earnings_surpriseadds the analyst optimism and forecast error over the price before the announcement (Frankel and Lee 1998) and the streak of beats or misses (Loh and Warachka 2012). (#752) -
get_value_scoreranks the tickers on six yields (earnings, book, sales, EBITDA to EV, cash flow and shareholder yield) as rank z-scores and averages them, next to the quality score. (#733) -
get_abnormal_capital_investment(Titman, Wei and Xie 2004),get_investment_to_assets(Lyandres, Sun and Zhang 2008) andget_operating_leverage(Novy-Marx 2011) are added to the efficiency ratios. (#733) -
get_intrinsic_valuation(cash_flow_type="Free Cash Flow to Equity")discounts the free cash flow to equity at the cost of equity straight into the equity value. (#734) -
get_adjusted_present_valuegives Myers' (1974) APV: the firm valued unlevered plus the interest tax shields discounted at the cost of debt. (#734) -
get_fama_french_cost_of_equitygives the cost of equity from 60-month Fama-French three-factor betas and the long-run factor premia of the same file. (#734) -
get_bottom_up_betarelevers the unlevered beta of each company's Damodaran industry at the company's debt to equity and tax rate, with the industry and region from Damodaran's own company list. (#734) -
get_accrual_componentssplits the accruals of Richardson, Sloan, Soliman and Tuna (2005) into the changes in working capital, non-current operating assets and liabilities, investments and financial liabilities, each over the average total assets. (#748) -
get_accounting_conservatismgives the accumulated negative non-operating accruals of Givoly and Hayn (2000),get_benford_scorethe first digits of a period's statements against Benford's law (the mean absolute deviation of Amiram, Bozanic and Rouen 2015 and the Kolmogorov-Smirnov statistic with its 5% critical value), andget_earnings_consistencythe earnings increase streak (Loh and Warachka 2012) and earnings consistency (Alwathainani 2009). (#748) -
get_earnings_attributes(method="leuz")gives the earnings management measures of Leuz, Nanda and Wysocki (2003): smoothness, the correlation of the changes in accruals and cash flows, and the accruals magnitude.get_discretionary_accrualsadds the Discretionary Accruals to Net Income (Hafzalla, Lundholm and Van Winkle 2011), andget_nissim_penman_decompositionthe Operating Profit Margin and Net Operating Asset Turnover, whose product is the RNOA. (#748) -
get_merton_distance_to_default(method=...)adds the iterative KMV procedure (Crosbie and Bohn 2003; Vassalou and Xing 2004), the naive model of Bharath and Shumway (2008), the Black-Cox first passage model (1976) and CreditGrades (Finger et al. 2002) with its CDS spread, and the default method adds the recovery rate and expected loss.get_altman_z_score(rating=True)gives the S&P rating equivalent of the Z''-EM score. (#750) -
get_intrinsic_valuation(terminal_method=...)adds the value driver formula of Koller, Goedhart and Wessels (NOPAT × (1 − g/RONIC) / (WACC − g)) and the exit multiple (EBITDA at the end of the projection times an EV/EBITDA multiple) as terminal values next to the growing perpetuity. (#751) -
get_gordon_growth_model(method=...)adds the total payout model (dividends plus net buybacks per share) and Walter's (1956) model,get_unlevered_beta(method=..., debt_beta=...)the Harris-Pringle and Miles-Ezzell betas besides Hamada with a debt beta, andget_justified_multiplesthe justified P/S. (#751) -
get_economic_value_added(method="momentum")gives the EVA Momentum of Stewart (2009): the change in EVA over a year as a share of the revenue of the year before. (#771) -
get_intrinsic_valuation(cash_flow_type="Economic Profit")gives McKinsey's economic profit valuation (Koller, Goedhart and Wessels): invested capital plus the present value of economic profits and the continuing value withreturn_on_new_invested_capital. With the same assumptions it equals the DCF. (#771) -
get_reverse_discounted_cash_flow(method="competitive_advantage_period")gives the market-implied competitive advantage period of Mauboussin and Johnson (1997): the years of value-creating growth the share price pays for beyond the steady-state value NOPAT/WACC. (#771) -
get_normalized_earningsgives Damodaran's normalized operating income, net income and EPS of cyclical companies: the average margin times the current revenue (default), the average return on capital, or the average earnings, overwindowyears. (#771) -
get_lintner_dividend_modelfits Lintner's (1956) partial adjustment model per company: speed of adjustment, target payout ratio, earnings coefficient and R². (#771) -
get_relative_valuationregresses P/E, P/B or P/S on growth, payout, beta and the return on equity or net margin across the Toolkit's tickers each period (Damodaran), with the predicted multiple and mispricing per company. (#771) -
get_weighted_average_cost_of_capital(debt_value="market")values the debt as a coupon bond at the pre-tax cost of debt of its synthetic rating (Damodaran), which then is the Cost of Debt, withdebt_maturity=years to go. (#774) -
get_optimal_capital_structuregives the WACC at debt ratios from 0% to 90% with relevered betas, iterated synthetic ratings and a tax benefit limited to the EBIT, and marks the debt ratio with the lowest WACC (Damodaran's cost of capital approach). (#774) -
get_net_borrowing_cost(method="pre_tax")gives the pre-tax cost of borrowing, the interest expense over the average total debt. (#774) -
get_weighted_average_cost_of_capitalandget_nissim_penman_decompositionwithtransform=work on a Toolkit without rounding, as the MCP server builds it. (#800)
Econometrics
get_level_significance(bins="0,0.5,1")counts the observations of every series per range between the edges, such as the days the %B of the Bollinger Bands closed below the lower band, in each half of the bands and above the upper band. (#795)get_unit_root_testadds the DF-GLS, ERS point-optimal and Ng-Perron tests on GLS-detrended data, andget_engle_granger_cointegration(method=...)the Phillips-Ouliaris residual tests and the Gregory-Hansen tests for a break at an unknown date, with the break date. (#759)get_cointegrating_regressionestimates the long-run relation by dynamic OLS, fully modified OLS or canonical cointegrating regression,get_ardl_bounds_testgives the Pesaran-Shin-Smith bounds F and t tests, andget_johansen_restriction_testtests whether a variable is excluded from the cointegrating vectors or weakly exogenous. (#759)get_streakswithruns=Truelists every run of a series above, at or below a level (or positive, negative or zero), with its start, end, length and peak;sign=keeps one kind. (#723)- A value at the level counts as at it, not above it, in
get_level_significance,get_streaksandget_window_change_by_year: 3.7 / 100 is stored as 0.037000000000000005, which counted as above 0.037. (#723) get_normality_testgives the Shapiro-Wilk (Royston 1992), Anderson-Darling, Lilliefors (Dallal-Wilkinson p-value) and D'Agostino-Pearson tests of every ticker's returns, withmethod=for the test, next to the Jarque-Bera test. (#735)get_runs_testgives the Wald-Wolfowitz runs test around the mean, median or zero, andget_bds_testthe BDS test of Brock, Dechert, Scheinkman and LeBaron (1996) for independence against any linear or nonlinear dependence. (#735)get_mincer_zarnowitz_testtests whether the EWMA or rolling variance forecast is unbiased (intercept 0, slope 1, optional Newey-West lags), andget_clark_west_testwhether an AR(1) forecast beats the historical average, the Clark-West (2007) test for nested models. (#735)get_local_projectionsgives Jordà's (2005) impulse responses of every ticker to a move inindependent_ticker(the Benchmark by default), with Newey-West confidence bands and a cumulative option. (#735)toolkit.performance.get_grs_testgives the Gibbons, Ross and Shanken (1989) test of whether the Fama-French factors (factors_to_calculate,region=) price all the Toolkit's tickers together, with the squared Sharpe ratios of the factors and of factors plus tickers. (#735)transform=takes the Hamilton (2018) regression filter (hamilton_trend,hamilton_cycle) and the Baxter-King (1999) and Christiano-Fitzgerald (2003) band-pass cycles (bk_cycle,cf_cycle) for yearly, quarterly, monthly and weekly data. (#735)transform=also takes the weighted moving average (wma), the position in the range (minmax), the rolling skewness and kurtosis,shift, the change in points over a year (yoy_diff),reciprocal,compound(returns into a cumulative return),drawdownand the STL seasonal adjustment of Cleveland et al. (1990) (deseasonalize,stl_trend,stl_seasonal). (#745)get_durbin_watson_test(method="breusch_godfrey", lags=)gives the Breusch-Godfrey LM and F tests of residual autocorrelation up to any order, valid with lagged regressors. (#761)get_heteroskedasticity_test(method="goldfeld_quandt"),get_ramsey_reset_test(method="rainbow" | "harvey_collier")andget_chow_test(method="quandt_andrews")add the Goldfeld-Quandt, rainbow, Harvey-Collier and sup-F tests. The sup-F test finds a break at an unknown date and gives it. (#761)get_non_nested_testcompares two non-nested regressions both ways with the J, encompassing or Cox test. (#761)get_ljung_box_test(method="box_pierce"),get_cusum_test(method="cusum_of_squares"), the Chow-Denning and Wright rank and sign tests inget_variance_ratio_test, and Hansen's linear-model stability test inget_nyblom_test(method="ols"). (#761)get_two_sample_t_test(method=...)adds the Mann-Whitney, Wilcoxon signed-rank, two-sample Kolmogorov-Smirnov, Levene, Brown-Forsythe and Bartlett tests. (#761)get_ols(method="huber" | "bisquare")fits robust M-estimation regressions, andget_time_varying_beta(method="rolling" | "expanding")gives OLS alpha and beta on rolling or expanding windows. (#761)get_correlation(lags=)gives the cross-correlation at leads and lags. (#761)get_var_lag_orderandget_var_forecast(lags="bic")choose the VAR order,get_var_diagnosticschecks stability and the residuals, andget_arima_forecast(select_order=True)picks p, d and q by the Hyndman-Khandakar search. (#761)financetoolkit.econometrics.get_multiple_testing_adjustmentgives Bonferroni, Holm, Hochberg, Benjamini-Hochberg and Benjamini-Yekutieli adjusted p-values of any set of tests. (#761)get_data_snooping_testgives the data-snooping tests of the tickers against the benchmark: whether the best of them still beats it once the search for it is taken into account, with Hansen's (2005) Superior Predictive Ability test (its lower, consistent and upper p-values), White's (2000) Reality Check or Romano and Wolf's (2005) StepM, which names every ticker that does, on the stationary bootstrap of Politis and Romano (1994). (#765)get_berkowitz_testandget_hong_li_testleave out a ticker with constant returns with its reason before fitting its forecasts, instead of handing the fit a series without volatility. (#773)get_exponential_smoothing_forecast(method=...)forecasts with simple exponential smoothing, Holt's linear trend, the damped trend (Gardner and McKenzie 1985) and Holt-Winters as ETS state space models (Hyndman, Koehler, Ord and Snyder 2008), or with the Theta method (Assimakopoulos and Nikolopoulos 2000), each with its prediction interval. (#772)get_seasonal_decomposition(method=...)splits a series into trend, season and remainder with STL (Cleveland et al. 1990), MSTL for several seasons (Bandara, Hyndman and Bergmeir 2021) or the classical moving-average decomposition, and gives the seasonally adjusted series. (#772)get_unobserved_componentsfits Harvey's (1989) structural time series model, a local level, local linear trend or smooth trend with a damped stochastic cycle, and gives the trend with its standard error, the cycle and its length. (#772)get_markov_regime_switching(ar_order=)fits the Markov switching autoregression of Hamilton (1989), whose regimes shift the mean while the autoregression is shared. (#772)get_spectral_density(method=...)gives the periodogram or Welch's (1967) averaged periodogram, andget_coherencethe coherence and phase of every series with another per frequency (Granger and Hatanaka 1964). (#772)get_long_memory_test(method=...)tests for long memory with the GPH log-periodogram regression (Geweke and Porter-Hudak 1983), the local Whittle estimator (Robinson 1995) or Lo's (1991) modified rescaled range, with d and the Hurst exponent d + 0.5. (#772)- The transform steps
bn_trendandbn_cyclegive the Beveridge-Nelson (1981) trend and cycle with the signal-to-noise restriction of the BN filter of Kamber, Morley and Wong (2018). (#772)
Economics
- The Sahm rule, Taylor rules, excess CAPE yield, equity-bond yield gap, yield-curve recession probability, government debt dynamics and yield decomposition take
transform,growthandlaglike the other Economics indicators. (#743) - A
transformwindow longer than the history in the date range is named, with the number of periods it needs and has and how to fix it, instead of a message that the source has no data. (#722) - A request without the United States no longer fetches the BLS price data, so it no longer warns about US gaps; this applies to
get_inflation_rateandget_real_interest_rate. (#722) - The US Treasury par yield curves (nominal and real) are read from the Treasury's new rate files after its old CSV and XML endpoints started answering 404, which restores the US daily long-term rate, the real yield curve and breakevens, the US government bond yield curve and the HQM spread over Treasuries, with unchanged figures. (#728)
- The
transformdocstrings say how much history before the start date the steps run on. (#724) get_sahm_rulegives the Sahm rule recession indicator per country from the monthly unemployment rate: the three-month average minus its low of the previous twelve months, with a recession signal at 0.5 percentage points (threshold=). (#727)get_taylor_rulegives the Taylor rule rate per country next to the policy rate, withmethod="original" (Taylor 1993), "balanced" (Yellen 2012) or "inertial", andneutral_rate=andinflation_target=. (#727)get_yield_curve_recession_probabilitygives the New York Fed's probability of a US recession twelve months ahead from the 10-year minus 3-month Treasury spread. (#727)get_excess_cape_yieldandget_equity_bond_yield_gapgive Shiller's Excess CAPE Yield (1/CAPE minus the real 10-year yield) and the earnings yield minus the 10-year yield (the Fed model), monthly from Shiller's data. (#727)get_government_debt_dynamicsgives the effective interest rate on government debt, the interest-growth differential (r − g), the debt-stabilizing primary balance and the gap of the actual primary balance to it. (#727)get_ofr_financial_stress_indexgives the Office of Financial Research's daily Financial Stress Index from 2000, with the contributions of credit, equity valuation, safe assets, funding and volatility, and of the United States, other advanced economies and emerging markets. (#729)get_financial_conditions_indexgives the Chicago Fed's weekly National Financial Conditions Index (NFCI) from 1971, with the adjusted index (ANFCI) and the risk, credit, leverage and nonfinancial leverage subindexes, through FRED (needs a FRED API key). (#729)get_national_activity_indexgives the Chicago Fed National Activity Index (CFNAI) with its three-month moving average and diffusion index, monthly from 1967, through FRED (needs a FRED API key). (#729)get_economic_policy_uncertaintygives Baker, Bloom and Davis's monthly Economic Policy Uncertainty index for 21 countries and the world. (#729)get_geopolitical_risk_indexgives Caldara and Iacoviello's monthly Geopolitical Risk index with its threats and acts, or the share of articles per country for 44 countries (measure="share"), from 1985 or from 1900 (historical=True). (#729)- Shiller's stock market data names Robert Shiller as its source on a fresh download, not the host of the data file. (#727)
get_net_liquiditygives US net liquidity daily from 2005: Fed total assets (H.4.1, the Wednesday level held until the next) minus the Treasury General Account (Daily Treasury Statement) minus the overnight reverse repo (New York Fed), in millions of dollars, with each component. (#736)get_central_bank_balance_sheetgives the total assets of the Federal Reserve, the Eurosystem, the Bank of Japan, the Bank of England, the Bank of Canada and the Reserve Bank of Australia in millions of local currency, weekly, monthly or quarterly as each publishes. (#736)get_natural_rate_of_interestgives the New York Fed's r-star estimates, Holston-Laubach-Williams for the United States, Canada and the euro area or Laubach-Williams for the United States (model=), with trend growth, other determinants and the output gap. (#736)get_consumer_inflation_expectationsgives the inflation US households expect one, three and five years ahead in the New York Fed's Survey of Consumer Expectations: the median, the 25th and 75th percentiles and the median point prediction. (#736)get_gdp_nowcastgives the Atlanta Fed's GDPNow nowcast of US real GDP growth per quarter through FRED (requires a FRED API key). (#736)FixedIncome.get_federal_reserve_yield_curvegives the Federal Reserve Board's Gürkaynak-Sack-Wright zero-coupon Treasury curves, daily: nominal from 1961 (1 to 30 years) and TIPS from 1999 (2 to 20 years), annually compounded.get_federal_reserve_svensson_parametersgives the Svensson parameters of each day's fit. (#737)get_term_premium(method="kim_wright")gives the Kim-Wright three-factor term premium, expected short rate and fitted yield from the Federal Reserve Board, daily from 1990 for 1 to 10 years, beside the ACM model. (#737)Economics.get_underlying_inflationgives the Cleveland Fed's median CPI and 16% trimmed-mean CPI, monthly from 1983, as the 12-month, monthly or annualized change (change=), through FRED. (#737)Economics.get_model_inflation_expectationsgives the expected inflation of the Cleveland Fed's model for horizons of 1 to 30 years, monthly from 1982, through FRED. (#737)get_implied_equity_risk_premiumgives Aswath Damodaran's implied equity risk premium of the S&P 500, monthly since September 2008 or yearly since 1960, with its inputs and variants. (#771)get_okuns_law(period=, window=)estimates Okun's law per country (the Okun coefficient, intercept, potential growth, R² and observations), quarterly from the OECD unemployment rate and GDP growth or yearly from the Global Macro Database, withwindow=for a rolling one. (#775)get_unemployment_rate(gap=True)gives the US unemployment rate minus the CBO's noncyclical rate of unemployment (FRED API key). (#775)get_labour_market_tightnessgives vacancies per unemployed person (V/U), monthly for the United States and quarterly for Eurostat countries. (#775)get_wage_growth(measure=, real=)gives year-over-year growth of US average hourly earnings or the Eurostat labour cost index, nominal or after CPI inflation. (#775)get_labour_force_participation(measure=)gives the labour force participation rate or the employment-to-population ratio (ILO modelled estimates via the World Bank). (#775)get_labour_sharegives the ILO labour income share of GDP for around 190 countries, from the new ILOSTAT source. (#775)get_credit_impulse(borrowers=)gives Biggs' credit impulse, the change in new credit as a share of GDP over a year, from the BIS total credit statistics. (#776)get_inflation_rate(measure="pce"|"core_pce")adds the BEA's PCE and core PCE inflation, andhorizon=gives 1- to 11-month annualized inflation on seasonally adjusted US indices. (#776)get_terms_of_tradegives export over import prices × 100 per country. (#776)get_house_prices(measure="price_to_income"|"price_to_rent")adds the OECD price-to-income and price-to-rent ratios. (#776)get_corporate_profits(period=, share_of_income=)gives US corporate profits (with IVA and CCAdj, before and after tax) from the BEA, in billions or as a share of gross domestic income. (#776)get_money_supply(method="velocity"|"excess_growth")gives the velocity of money and money growth in excess of nominal GDP growth. (#776)get_real_interest_rate(natural_rate_gap=True)gives the real interest rate minus the New York Fed's Holston-Laubach-Williams r* (United States, Canada, Euro Area). (#776)
Ratios
- New characteristic ratios: cash to assets (Palazzo 2012), asset tangibility and liquidation value (Almeida and Campello 2007; Berger, Ofek and Swary 1996), the depreciation rate and the average age, useful and remaining life of fixed assets, net long-term asset turnover, the Lev and Thiagarajan fundamental signals, the tax to book income ratio (Lev and Nissim 2004), the tax expense surprise (Thomas and Zhang 2011), dirty surplus, cash productivity (Chandrashekar and Rao 2009), the enterprise book-to-price of Penman, Richardson and Tuna (2007), the revenue growth rank (Lakonishok, Shleifer and Vishny 1994), firm age and dividend initiations, omissions and expected dividend months. (#749)
- New options: operating working capital turnover, R&D to market cap, R&D capital and the R&D surprise, Ball et al.'s (2015) operating profitability and price to earnings plus depreciation.
models.get_organization_capitalgives the organization capital of Eisfeldt and Papanikolaou (2013). (#749) - The FFO to debt, cash interest coverage and interest paid to expense ratios name the tickers whose cash flow statement does not state the interest paid (FinancialModelingPrep gives 0), instead of an empty answer without a reason. The interest paid to expense ratio leaves those periods out (NaN) rather than answering 0. (#726)
- New ratios: the cash return on equity, S&P's free operating cash flow to debt, the short-term debt ratio (Barclay and Smith 1995), debt to enterprise value (gross or net), cash turnover (Ou and Penman 1989), the composite debt issuance (Lyandres, Sun and Zhang 2008), dividend growth and the dividend increase streak, and
get_capital_allocation, the shares of capital expenditure, R&D, acquisitions, working capital, dividends and buybacks in what a company spends (Mauboussin and Callahan). (#747) - New options: the total and net total payout ratio (Grullon and Michaely 2002), the gross payout yield (Boudoukh, Michaely, Richardson and Roberts 2007), total liabilities to assets and to market cap (Bhandari 1988), debt to capital at market value, S&P's FFO cash interest coverage, the CFA cash flow ratios (CFO to operating income, dividend payment and reinvestment ratios), sales to inventory, inventory investment (Thomas and Zhang 2002) and the net equity and net debt financing of Bradshaw, Richardson and Sloan (2006). (#747)
Technicals
get_reflex_oscillatorgives Ehlers' (2020) zero-lag Reflex (the cycle) and, withmethod="trendflex", Trendflex (the trend), andget_cyber_cycleEhlers' (2004) Cyber Cycle with its trigger line;get_swiss_army_knife_filteradds Ehlers' (2013) decycler and roofing filter. (#757)get_williams_alligatorgives Bill Williams' Jaw, Teeth and Lips with the Gator Oscillator histograms,get_random_walk_indexPoulos' (1991) RWI High and Low,get_trend_intensity_indexPee's (2002) Trend Intensity Index,get_elder_impulseElder's (2002) Impulse System andget_time_segmented_volumethe Time Segmented Volume with its signal line. (#757)get_fair_value_gapsmarks three-candle fair value gaps (direction, top, bottom and size) with the order block before each gap. (#757)- New options: the ATR Trailing Stop (
get_supertrend(method="atr_trailing_stop")), Elder's SafeZone stop (get_chandelier_exit(method="safezone")), the moving average envelope (get_bollinger_bands(method="envelope")), the volume z-score (get_relative_volume(method="z_score")), Altman's (1993) Relative Momentum Index (get_relative_strength_index(method="momentum")), Hannula's (1994) Polarized Fractal Efficiency (get_efficiency_ratio(method="polarized_fractal")) and the Elastic Volume Weighted Schaff Trend Cycle. (#757)
Fixed income
get_yield_curve_spread(period=...)gives the spreads and butterflies per date ("10Y-2Y", "2Y/5Y/10Y") withtransform, for the history of the slope of the curve. (#746)
Documentation
- Every formula in the docstrings is written in one plain grammar (names, operators, functions such as
sum(t=1..N, ...), subscripts asX_t, lags asX(t-1)), so the documentation renders each line as an equation; a test checks every formula line against the grammar the documentation uses. Prose that sat in formula lines moved into sentences, and formulas that disagreed with the code now describe what the code calculates. (#777, #779, #780, #781, #782, #783, #784, #785, #786, #789) - Every method names where it comes from: the paper or book that defines it, the library its values are checked against ("Referenced against", with a test holding the library's numbers) or shares its logic with, and, for data, the publisher, series name, series code and link under "Data source:". This adds references to about 470 methods, among them new comparisons with QuantLib (the Greeks, Garman-Kohlhagen, binary options, forward rates, par yields), Riskfolio-Lib, PyPortfolioOpt and scipy, all agreeing; every journal citation was checked against its publisher's record, and a test makes every new method name its references. (#787, #788, #790, #791, #793, #794)
- The README links each walkthrough section to its documentation page and the methods it uses, and points to the project page, the article on connecting Claude and the MCP pages. (#792, #796, #797)
MCP server
-
A Claude plugin in
plugins/financetoolkitconnects Claude to the hosted server, with a skill on using the tools, for the Claude directory. (#799) -
The bundle description gives the current breakdown of the 1400+ methods and the 50+ official data sources. (#798)
-
The
modelstool is split into four:models(valuation),cost_of_capital(WACC, unlevered and bottom-up beta, Fama-French and implied cost of capital, optimal capital structure),distress_models(distress, credit and financial constraint models) andquality_models(quality, earnings quality, profitability models and factor analysis). Calling a moved indicator onmodelsstill reaches it. (#768) -
With a currency, the answers whose amounts stay as published (calendars, the price target history, filings and the market values of fund holdings) say so instead of that they are converted, and quotes and prices no longer add the listing-currency note. (#756)
-
The econometrics tool is split into three:
econometricsfor the models (regressions, VAR, VECM and ARIMA forecasts, local projections, regimes, connectedness, entropy, pairs trading and the significance of a value or move),statistical_testsfor the hypothesis tests andcausal_inferencefor the causal designs (difference-in-differences, event study, synthetic control, regression discontinuity, propensity score matching). The indicator names are unchanged, and an indicator called on the econometrics tool is answered by the tool it is in. (#762) -
The risk tool is split into four:
riskfor value at risk, drawdowns and the distribution measures,volatility_modelsfor the GARCH models and volatility estimators,market_liquidityfor the liquidity measures and idiosyncratic risk, andsystemic_riskfor copulas, CoVaR, SRISK and the other dependence measures. A split tool keeps the defaults and parameter descriptions of the tool it came from, and a call orseries=reference to the earlier tool is answered by the tool the indicator is in now. (#767) -
One tool in the listing can be up to 13,000 characters and all tools together up to 240,000. (#753, #762, #767)
-
rebase_totakes quarters ('2023Q4', '2023Q4:2024Q1'), and aseries=reference that names Total says to list the basket's tickers with basket=true. (#742) -
The
macroeconomics,jobsandratestools takepoint_in_time=true(with a FRED API key): the US FRED series as first published, indexed by the day each was published; other indicators are left out with the reason. (#740) -
The fixed income, rates and macroeconomics tools take the Gürkaynak-Sack-Wright curves and their parameters, the Kim-Wright term premium, and the Cleveland Fed's underlying inflation and inflation expectations. (#737)
-
The rates and macroeconomics tools take US net liquidity, the central bank balance sheets, the natural rate of interest, consumer inflation expectations and GDPNow. (#736)
-
The econometrics tool takes the normality, runs, BDS, Mincer-Zarnowitz and Clark-West tests and local projections, the performance tool the GRS test, and every
transform=the Hamilton, Baxter-King and Christiano-Fitzgerald filters; the stated number of metrics is now 1400+. (#735, #749) -
The models tool takes the FCFE valuation, the adjusted present value, the Fama-French cost of equity and the bottom-up beta. (#734)
-
The models and efficiency tools take the implied cost of capital variants, the Frankel-Lee value, equity duration, forecast dispersion, the value score and the investment characteristics. (#733)
-
The market_data, environment, etf and discovery tools take the new FMP data; the ETF and fund holders answer the 25 largest by default. (#731)
-
The performance and risk tools take the absorption ratio, financial turbulence, the return signals and the Frazzini-Pedersen Beta. (#732)
-
currencyon the tools whose amounts it converts (market_data, the ratio and technicals tools, models, etf, performance, risk and portfolio), with a note on which rate each amount uses. (#721, #730) -
The
econometricstool takesrunsandsignforget_streaks. (#723) -
An empty
transformanswer gives the window it needs as its reason. (#722) -
The jobs, rates, macroeconomics and government tools take the new indicators, and the economy check prompt uses the Sahm rule and the recession probability. (#727)
-
The macroeconomics tool takes the OFR, Chicago Fed, policy uncertainty and geopolitical risk indices. (#729)
-
The Docker image runs on uv 0.13.12 and the latest python 3.12-slim image. (#778)