Skip to main content
Skip to content
Agentic Finance

Qlib IC and RankIC in 2027: Match the Signal to Its Holding Period

Compare Qlib IC and RankIC across declared return horizons. DN’s 2027 worksheet shows how fixed scores can change meaning when the future target changes.

One luminous marker faces three layered amber and cobalt horizons extending into different distances.
Reading options: audio, text size & sections

What Matters

A signal’s information coefficient answers a question about a particular future return. Change that return horizon and the answer can change, even when the signal stays fixed. DN’s original five-asset example moves from positive association to zero and then negative association across three authored horizons. Define the label, timing and comparison population before treating IC or RankIC as evidence for a holding period.

Evidence status — checked 28 November 2026: This article combines inspected Qlib source with an independently executed synthetic calculation. All five scores and future prices were authored for the example. No Qlib model was trained, no market factor was evaluated and no portfolio return was produced. The 2027 edition describes a reproducible evaluation method.

A research report says a model ranks assets well. The chart contains a positive IC, a useful-looking RankIC and a confident description of the signal. You intend to hold positions for several weeks. The report evaluates tomorrow’s return. Has it answered your question?

It has answered a related question with a different target. A short-horizon relationship may persist, disappear or reverse at another horizon. The only way to find out for a real signal is to define and evaluate those targets using an appropriate sample. A strong result for one label is not permission to substitute another.

This is a specification problem before it is a model-selection problem. You need to know when the score exists, which price starts the return measurement, which price ends it and which assets remain in the comparison. Once those choices are explicit, the resulting statistics become much easier to interpret.

What are IC and RankIC in Qlib?

In the inspected Qlib evaluation code, the information coefficient, or IC, is the Pearson correlation between prediction scores and labels. RankIC uses Spearman rank correlation. The official report documentation describes these measures, while the pinned implementation records the source version inspected for this article.

For a cross-sectional return test, the comparison pairs each asset’s score with that same asset’s future return. Pearson correlation reflects a linear relationship between the numeric values. Spearman correlation first replaces the values with ranks, then measures association between those ranks. The two statistics can differ when spacing between values changes while their order remains similar.

Neither statistic is itself a portfolio return. An IC does not specify how much capital goes into each asset, which positions can be executed, how frequently they are changed or what they cost. DN’s ranking-to-portfolio experiment examines that next step. Here we hold the score vector fixed and examine what happens when the forward target changes.

Write the return label before reading the score

Qlib’s inspected Alpha158 default label uses the close two bars ahead divided by the close one bar ahead, minus one. The relevant definition appears in the pinned data handler. The source also allows configurable labels; that default is not a universal statement about every Qlib experiment.

For DN’s example, scores are known at time t. Every horizon uses the close at t+1 as its reference. A horizon of h bars ends at t+1+h. The return is the ending close divided by the reference close, minus one. Thus our one-bar return ends at t+2, the five-bar return at t+6 and the twenty-bar return at t+21.

This convention deliberately separates score time from the reference price. It does not claim that an order actually filled at that reference. A label defines the outcome used to assess a prediction; an execution model defines how a trading instruction might become a position. Combining them without explanation can make an evaluation appear more practical than it is.

“Bar” also requires a definition. Five hourly observations are not five trading sessions. If the data frequency changes, the calendar meaning of a fixed bar count changes with it. A return-horizon record should state both the number of bars and the relevant observation calendar.

Five fixed scores, three different answers

Our original fixture contains five fictional assets, A through E. Their scores are 1, 2, 3, 4 and 5. Every reference close is 100. We authored the future endpoints to make three relationships directly visible; there is no hidden optimisation or sampled market history.

AssetFixed scoreOne-bar returnFive-bar returnTwenty-bar return
A1−4%−1%+4%
B2−2%+2%+2%
C30%0%0%
D4+2%+2%−2%
E5+4%−1%−4%

At one bar, higher scores line up with higher returns. Both Pearson IC and RankIC equal +1. At five bars, the returns form a symmetric pattern around the middle asset; both statistics are zero. At twenty bars, the return order reverses the score order; both statistics equal −1.

These are designed arithmetic examples, not plausible performance estimates for a deployed model. Their value is that the score vector and population do not move. The changed answer comes from the changed predictive target, so the reader can inspect the mechanism without needing a large data pipeline.

The fixture supplies endpoints only. It does not supply the intervening price paths, exits, rebalancing rules or trading costs. A move from positive to negative correlation across those endpoints therefore does not reveal a continuous decay curve or identify the best moment to trade.

Rank ties and asset identity are part of the calculation

The five-bar returns contain ties. A and E share the lowest return, while B and D share the highest. DN assigns ascending average ranks: 1.5, 4.5, 3, 4.5 and 1.5. This means tied values share the average of the rank positions they occupy.

Giving tied observations arbitrary distinct ranks would add an ordering the data do not contain. The effect can be especially visible in a small example. A reproducible comparison therefore records its tie convention rather than relying on an unnamed spreadsheet or library default.

Asset identity matters even more. Independently sorting the scores and returns would manufacture a flattering relationship by pairing values that no longer belong to the same assets. Keep the asset identifier attached to both values through every transformation. Sort only when the statistic itself requires ranks, then preserve the correspondence.

Correlation is undefined when there is too little variation to compare, or too few valid pairs. DN’s original calculation returns an undefined result for a constant vector or fewer than two pairs. It does not turn an impossible calculation into an apparently neutral zero.

Signal and forward-horizon comparison

Hold a score column fixed and compare one-, five- and twenty-bar labels from the same next-bar reference. The initial endpoints are designed teaching values; a bar is the declared observation interval, not automatically one day.

Works in your browser with your inputs. No account, data subscription or broker connection is required.

All horizons use the same 5-asset complete-case cohort. Labels are endpoint close divided by the common next-bar reference, minus one.

Assets in every horizon
5
Assets excluded from every horizon
0
1-bar Pearson IC
1
1-bar Spearman RankIC
1
5-bar Pearson IC
0
5-bar Spearman RankIC
0
20-bar Pearson IC
-1
20-bar Spearman RankIC
-1
AssetFixed score1-bar return (%)5-bar return (%)20-bar return (%)5-bar return midrank
A1-4-141.5
B2-2224.5
C30003
D422-24.5
E54-1-41.5

No assets were excluded for missing values.

Pearson IC correlates scores with labels. RankIC correlates their ascending average ranks. Exact decimal ratios determine return ties; fewer than two paired assets or zero variance makes the relevant correlation undefined.

One authored cross-section does not measure a factor’s half-life, statistical significance, temporal stability or profitable holdings. No Qlib training, market data or model run is represented.

The initial result is a worked example. Changing an input changes the stated scenario, not an exchange account or a verified market result.

Keep the population constant when comparing horizons

A horizon comparison can change for two reasons at once: a different future target and a different set of assets. Suppose an asset has a one-bar price but lacks a twenty-bar endpoint. If it remains in one calculation and disappears from another, the resulting statistics describe different populations.

DN’s teaching fixture uses a joint complete-case rule. An asset missing any required score, reference close or future endpoint is excluded from all three horizons. The main example has all five assets, and the checks exercise missing-value treatment separately. This creates a controlled comparison of the declared horizons.

That rule is useful for isolating the arithmetic, but it is not automatically the right research population for every real study. Excluding assets because a later observation is unavailable can create its own selection problem. A delisted instrument, for example, needs an explicit outcome policy; absence should not silently become a zero return or an easy exclusion.

A full report should show both eligible and retained counts, reasons for exclusion and how the population was defined at the score time. If an analyst also publishes horizon-specific samples, those results should be labelled as different comparisons rather than presented as a pure change in horizon.

What a real signal-horizon study would need

The next step is a panel of dated score records and subsequent outcomes. Fix a research specification before inspecting which horizon looks most attractive. It should state the score’s publication time, data cutoff, universe, return basis, endpoint convention and intended use.

Design choiceWhy it changes interpretation
Score timestamp and data cutoffEstablish what could have been known before the target return began.
Reference price and execution assumptionSeparate the prediction target from the price at which an order could fill.
Horizon and calendarDefine the future outcome that the signal is supposed to rank.
Universe and missing-outcome policyShow which assets contribute and whether later availability changes the sample.
Dates and aggregation ruleDistinguish a collection of cross-sectional results from one pooled calculation.
Selection and holdout procedureReveal whether the reported horizon was chosen after looking at the same results.

Calculate dated cross-sectional results when that is the stated task, then explain how they are summarised. Pooling every asset and date into one correlation can answer a different question from averaging correlations calculated separately for each date. A clear report identifies the unit of evaluation.

Longer return windows can overlap. That means neighbouring observations may share much of the same price movement. A large row count alone does not establish independent evidence. Any uncertainty estimate or significance claim needs a method appropriate to the dependence in the data.

Trying many horizons also introduces a selection decision. If the analyst searches for the strongest-looking interval and then reports only that interval, the reader cannot see how much exploration preceded the result. Preserve the alternatives and distinguish exploration from the evaluation reserved for the chosen procedure.

How to use IC and RankIC in a product decision

A reader comparing two research services should first ask whether their target definitions match. A service publishing next-bar RankIC and another publishing twenty-bar IC have not supplied a directly comparable pair of scores. Request the labels and population records before ranking the providers.

A team building a weekly research process can use the same question internally: does the model’s measured relationship correspond to the decision schedule? If the research target is much shorter than the action schedule, that mismatch becomes a testable requirement. It should not be concealed by a generic claim that the model has a positive information coefficient.

Even after the horizon fits, portfolio construction remains separate. Holding rules, turnover, exposure constraints and executable prices can alter the economic outcome. A reported correlation should lead to a further specification and test, rather than a promise about returns. The Alpha158 feature audit provides the corresponding distinction between an input library and a completed strategy.

Methodology and a useful handover

The original Python fixture uses exact rational arithmetic for labels, tie ranks and centred sums, followed by standard-library floating-point calculations for final correlations. It checks the designed +1, 0 and −1 results, asset alignment, average ranks, missing-value handling and undefined cases. The browser worksheet implements the disclosed comparison for reader-supplied scenarios.

The input and script hashes, executed outputs and methodological notes are provided in the calculation pack. No Qlib runtime, training procedure, portfolio optimiser or live market is involved in DN’s example. It cannot estimate a factor’s half-life, persistence, statistical significance or investment value.

A useful handover is a compact label contract plus the dated score/outcome records required to repeat the comparison. Keep the chosen horizon in the article, table and exported result. If a team needs to determine whether a vendor’s reported benchmark answers its actual task, the DN Research Desk can scope a review of the definitions, evidence and next tests.

Download the dated source and scenario record (JSON) · Download the reproducible calculation pack (ZIP).

Frequently asked questions

What is the difference between Qlib IC and RankIC?

In the inspected evaluation code, IC uses Pearson correlation between scores and labels. RankIC uses Spearman correlation, which compares their ranks. Both require aligned score/label pairs and a defined future target.

What does the Alpha158 default return label measure?

The inspected default divides the close two bars ahead by the close one bar ahead and subtracts one. Qlib labels can be configured, so the expression must be checked in the particular experiment rather than assumed universally.

Do one, five and twenty bars mean days?

Only if the declared data frequency and calendar make them days. A bar is an observation interval. The article’s original fixture specifies bar offsets and does not assign them a market calendar.

Does a positive RankIC establish a profitable strategy?

No. It describes a ranking association for the stated labels and sample. It does not specify position sizing, turnover, execution, costs or a complete portfolio rule.

Does this measure a real signal’s decay or half-life?

No. The scores and future endpoints were authored for one illustrative cross-section. Estimating real persistence or decay would require a dated sample and an appropriate evaluation design.

Continue your research

Primary sources and evidence

Editorial disclosure: This research explains documented capabilities and original worked examples. Inclusion does not imply endorsement, a commercial relationship or verified trading performance. No placement in this article was purchased.

Corrections and updates: Send source-backed corrections to press@decentralised.news. This 2027 edition was checked on 28 November 2026; documentation, permissions and product availability can change.

Get the most talked about stories directly in your inbox

Join the Decentralised News briefing for independent crypto, DeFi and AI analysis. No spam, unsubscribe anytime.