Factor analysis (predictive power) of the technical indicators: whether the tickers that score high on an indicator go on to return more than those that score low. Per period, the information coefficient (IC) is the Spearman rank correlation between the indicator of the tickers at the end of the period and their return over the following horizon: 1 means the indicator ranks the later returns perfectly, -1 in reverse and 0 that it says nothing about them. The IC measures skill in Grinold and Kahn’s fundamental law of active management, IR ≈ IC × √breadth: a small but consistent IC across many tickers and periods gives a high information ratio.

The summary has a row per indicator and horizon with the mean IC, its standard deviation, the IC information ratio (mean divided by standard deviation), the t-statistic of the mean with its p-value, the share of periods with a positive IC, the number of periods, the top minus bottom spread (the mean forward return of the highest quantile minus that of the lowest), the mean turnover of the top and bottom quantiles and the mean rank autocorrelation of the indicator from one period to the next. With detail, it returns one of those parts per period (or per quantile) for a single indicator.

The indicators are calculated daily and the value on the last trading day of each period is compared with the returns from that day’s close onwards, using the dividend and split adjusted close. An indicator in price units does not compare across tickers with different share prices, so a price line (a moving average, band, channel, stop or cloud line) is used as the distance of the close from it, close / line - 1, and a price difference (the true range, ATR, MACD, awesome oscillator, elder ray and detrended price oscillator) as a share of the close. Each ticker keeps its own history: a ticker without a value or a return in a period is left out of that period only.

Factor Analysis in Python

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_factor_analysis as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["AAPL", "MSFT", "GOOGL", "AMZN", "META", "NVDA", "JPM", "JNJ",
     "XOM", "PG", "KO", "WMT", "V", "UNH", "HD", "CVX"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2016-01-01",
    end_date="2025-12-31",
)

# The 200-day rate of change and the distance of the close from its 200-day average.
toolkit.technicals.get_factor_analysis(
    ["get_rate_of_change", "get_moving_average"], horizons=[1, 12], window=200
)

Which returns:

  Mean IC IC Standard Deviation IC Information Ratio t-Statistic p-Value Positive Share Observations Top Minus Bottom Quantile Turnover Rank Autocorrelation
(‘get_rate_of_change’, ‘1 Month’) 0.053 0.3536 0.1499 1.5718 0.1189 0.6 110 0.0097 0.2652 0.8603
(‘get_rate_of_change’, ‘12 Months’) 0.1272 0.4137 0.3074 3.0587 0.0029 0.6364 99 0.0614 0.2652 0.8603
(‘get_moving_average’, ‘1 Month’) 0.0432 0.3494 0.1236 1.2968 0.1974 0.5818 110 0.0128 0.3068 0.8064
(‘get_moving_average’, ‘12 Months’) 0.1073 0.3924 0.2735 2.7212 0.0077 0.596 99 0.0574 0.3068 0.8064

Parameters

get_factor_analysis accepts the following parameters.

ParameterTypeDescriptionExample
metricsstr | list[str]An indicator method name, e.g. “get_relative_strength_index”, a list of them, or a collection: “momentum”, “overlap”, “volatility”, “breadth” or “all”. Defaults to “momentum”, the oscillators and momentum indicators. The collections leave out the market-wide breadth measures, the volume-scaled indicators and the pivot points and Fibonacci levels.
periodstrThe frequency at which the indicators are evaluated: daily, weekly, monthly, quarterly or yearly. Defaults to “monthly”."weekly"
horizonslist[int] | int | NoneThe number of periods the forward returns cover. Defaults to None, which uses about a period, a quarter and a year ahead (1, 3 and 12 months for monthly).None, which uses about a period, a quarter and a year ahead (1, 3 and 12 months for monthly)
quantilesintThe number of quantiles the tickers are sorted into per period. Defaults to 5.[0.05, 0.5, 0.95]
periods_apartintThe number of periods between the dates the quantile turnover and the rank autocorrelation compare. Defaults to 1.1
detailstr | NoneReturns one part of the analysis of a single indicator instead of the summary: “information_coefficient” (per period and horizon), “quantile_returns” (the mean forward return per quantile and horizon), “quantile_turnover” (per period and quantile) or “rank_autocorrelation” (per period). Defaults to None.None
columnstr | NoneThe output to use of an indicator with several, e.g. “Signal Line” of the MACD or “Upper Band” of the Bollinger Bands. Defaults to None, which uses the first output in alphabetical order other than a price, e.g. “MACD Line” or “Lower Band”."Return"
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the Toolkit’s rounding. **kwargs: Parameters passed to the indicators that take them, e.g. window=14 or close_column=”Close”.2
Share