Overall top-100 hits
30.71
average across horizons
Predicted top-100 avg actual rank
230.84
lower is better
Rank IC
0.0486
picks the better of two stocks
51.5% of the time
IC reliability
4.67
t-stat;
IC positive 57.6% of months
not adjusted for overlapping windows
not adjusted for overlapping windows
Horizon Breakdown
top 100 only| Horizon | Average Top-100 Hits | Predicted Top-100 Avg Actual Rank | Rank IC |
|---|---|---|---|
| 3m | 30.66 | 232.02 | 0.0460 |
| 6m | 30.48 | 232.14 | 0.0440 |
| 12m | 30.99 | 228.35 | 0.0557 |
Run Note
test summaryExclude Structurally Weak Sectors: 30.71 avg hits@100 (3m 30.66, 6m 30.48, 12m 30.99); avg actual rank 230.84; IC +0.0486 (t 4.67).
Run Details
strategy_test_results #114| id | 114 |
|---|---|
| strategy_id | strategy_000104 |
| strategy_title | Exclude Structurally Weak Sectors |
| strategy_hash | ff31b3dbe40cab105db30a5910966de5ee3d7d974d05b0e02ec34b35f06ddc6f |
| evaluator_version | v3_top100_monthly |
| start_date | 2015-01-01 |
| end_date | 2025-06-01 |
| created_at | 2026-07-25 11:15:04 |
| updated_at | 2026-07-25 13:17:03 |
Sample Top-100 Lists
2020-03-31 / 6m / 34 hitsPredicted top 100
AAL, ADBE, ADI, AFL, AIG, ALK, AMAT, AMD, AMP, ANET, APTV, AVGO, AXP, BA, BAC, BKR, C, CCL, CF, CFG, CI, CMG, COF, COP, CRM, CTAS, CVX, DAL, DHI, DRI, DVN, DXC, EOG, ETSY, EXPE, FANG, FCX, FITB, FTNT, GE, GM, GPS, HAL, HIG, INTC, INTU, ISRG, IVZ, KEY, KLAC, KMI, LEN, LKQ, LNC, LRCX, LYB, LYV, MA, MCHP, MCO, MGM, MOS, MPC, MS, MSFT, MU, NCLH, NOV, NOW, NVDA, NWL, OKE, OXY, PAYC, PHM, PRU, PYPL, QCOM, RCL, ROST, RTX, SLB, SPGI, SWK, SYF, SYY, TDG, TER, TFC, TPR, TSLA, UAL, UHS, ULTA, URI, V, VLO, WDC, WMB, WYNN
Actual top 100
AAP, AAPL, ABMD, ADBE, ADSK, ALB, ALGN, AMD, AMP, AMZN, APD, APH, APTV, ATVI, AVGO, BBY, BWA, CARR, CDNS, CE, CHRW, CMG, CMI, CPRT, CRM, CTAS, CTLT, CTSH, DD, DE, DHI, DHR, DRI, DXCM, EBAY, EMN, ETSY, EXPE, FCX, FDX, GLW, GPS, HAL, HD, IDXX, IPGP, JCI, KMX, LEG, LEN, LH, LOW, MAS, MCHP, MGM, MOS, NCLH, NKE, NOW, NSC, NVDA, NWS, NWSA, ORLY, PAYC, PH, PHM, PNR, POOL, PVH, PWR, PYPL, QCOM, QRVO, RCL, ROK, ROL, SHW, SIVB, SNPS, SWK, SWKS, SYF, TDG, TEL, TER, TGT, TMO, TSCO, TSLA, TT, UPS, URI, VAR, VIAC, VTR, WHR, WMB, WST, WY
Matched tickers
ADBE, AMD, AMP, APTV, AVGO, CMG, CRM, CTAS, DHI, DRI, ETSY, EXPE, FCX, GPS, HAL, LEN, MCHP, MGM, MOS, NCLH, NOW, NVDA, PAYC, PHM, PYPL, QCOM, RCL, SWK, SYF, TDG, TER, TSLA, URI, WMB
Strategy Script
ff31b3dbe4"""Generated V3 stock-ranking strategy."""
from __future__ import annotations
import numpy as np
import pandas as pd
STRATEGY_ID = "strategy_000104"
STRATEGY_TITLE = "Exclude Structurally Weak Sectors"
DESCRIPTION = """
Utilities, Real Estate and unknown are the three groups whose low hit rate is
most stable across blocks. A hard exclusion should therefore be the best case
for the filter idea explored earlier - and it tests the claim that a strategy-
level filter can only lose.
"""
FACTORS_USED = [
"vol_63d",
"revenue_growth_pct",
"dollar_volume_21d",
"market_cap",
"free_cash_flow_margin_pct",
"forward_pe",
"pe",
"eps_growth_pct",
"operating_income_growth_pct",
"free_cash_flow_growth_pct",
"volume"
]
PARAMETERS = {
"vol_63d": 1.0,
"revenue_growth_top": 0.4,
"turnover": 0.4,
"dollar_volume_21d": 0.15,
"fcf_margin_top": 0.15,
"fam_value": -0.164,
"fam_steadiness": 0.0218,
"fam_growth": -0.065,
"volume_raw": 0.05,
"fcf_margin": 0.225
}
COMPLEXITY = 10
PARENT_STRATEGY_ID = "strategy_000083"
GENERATION = 104
RANDOM_SEED = 20260904
CREATED_AT = "2026-07-25T00:00:00+00:00"
def _date_group(df):
if "trade_date" in df.columns:
return df["trade_date"]
return pd.Series(0, index=df.index)
def _rank_pct(df, series):
"""Date-local rank percentile centred on zero; missing values stay neutral."""
clean = pd.Series(series, index=df.index).replace([np.inf, -np.inf], np.nan)
ranked = clean.groupby(_date_group(df)).rank(pct=True)
return ranked.fillna(0.5) - 0.5
def _rank_col(df, column):
if column not in df.columns:
return pd.Series(0.0, index=df.index)
return _rank_pct(df, df[column])
def _zscore_col(df, column):
if column not in df.columns:
return pd.Series(0.0, index=df.index)
clean = df[column].replace([np.inf, -np.inf], np.nan)
grouped = clean.groupby(_date_group(df))
mean = grouped.transform("mean")
std = grouped.transform("std").replace(0, np.nan)
return ((clean - mean) / std).fillna(0.0)
def _top_half(series):
"""Emphasise only the upper half of a centred rank, leaving the rest flat."""
return series.clip(lower=0.0) * 2.0 - 0.25
def _turnover(df):
market_cap = df["market_cap"].replace(0, np.nan) if "market_cap" in df.columns else np.nan
return _rank_pct(df, df["dollar_volume_21d"] / market_cap)
def _range_252(df):
return _rank_pct(df, df["from_low_252d"] - df["from_high_252d"])
def _growth_frame(df):
cols = ["eps_growth_pct", "revenue_growth_pct",
"operating_income_growth_pct", "free_cash_flow_growth_pct"]
return df[cols].replace([np.inf, -np.inf], np.nan).clip(lower=-100, upper=300)
def _steadiness(df):
"""Reward growth that is consistent across the four metrics, not one spike."""
g = _growth_frame(df)
mean = g.mean(axis=1).fillna(0)
spread = g.std(axis=1).fillna(0)
breadth = (g > 0).sum(axis=1) / g.shape[1]
return breadth - (spread / (mean.abs() + 50)).clip(lower=0, upper=3)
def _overheat(df):
"""Penalise a growth spike that revenue does not support, worse when price is hot."""
g = _growth_frame(df)
quality = g[["eps_growth_pct", "operating_income_growth_pct",
"free_cash_flow_growth_pct"]].max(axis=1).fillna(0)
unsupported = (quality - g["revenue_growth_pct"].fillna(0) - 100).clip(lower=0, upper=300) / 100
explosive = (g.max(axis=1).fillna(0) - 100).clip(lower=0, upper=300) / 100
hot = (
(df["return_1m_pct"].fillna(0) > 25).astype(float)
+ (df["return_3m_pct"].fillna(0) > 60).astype(float)
+ (df["from_52w_high_pct"].fillna(-1) > -2).astype(float)
) / 3.0
return explosive * (1 + hot) + 0.7 * unsupported
def _constructive_pullback(df):
"""Distance below the 52-week high, counted only while 6-month return is positive."""
pull = (-df["from_52w_high_pct"].fillna(0)).clip(lower=0, upper=0.45)
return pull.where(df["return_6m_pct"].fillna(0) > 0, 0)
def _zscore_series(df, series):
clean = pd.Series(series, index=df.index).replace([np.inf, -np.inf], np.nan)
grouped = clean.groupby(_date_group(df))
mean = grouped.transform("mean")
std = grouped.transform("std").replace(0, np.nan)
return ((clean - mean) / std).fillna(0.0)
def _revenue(df):
return df["revenue_ttm"].replace(0, np.nan) if "revenue_ttm" in df.columns else pd.Series(np.nan, index=df.index)
def _revenue_lag(df, periods):
"""Revenue_ttm shifted back N monthly observations per ticker, trailing only."""
if "revenue_ttm" not in df.columns or "ticker" not in df.columns:
return pd.Series(np.nan, index=df.index)
order = df.sort_values(["ticker", "trade_date"]).index
shifted = _revenue(df).loc[order].groupby(df["ticker"].loc[order]).shift(periods)
return shifted.reindex(df.index)
def _sector(df):
if "sector" not in df.columns:
return pd.Series("unknown", index=df.index)
return df["sector"].fillna("unknown")
def _sector_group(df):
return [_date_group(df), _sector(df)]
def _sector_rank(df, column):
"""Rank percentile within (date, sector) instead of within date."""
if column not in df.columns:
return pd.Series(0.0, index=df.index)
clean = df[column].replace([np.inf, -np.inf], np.nan)
ranked = clean.groupby(_sector_group(df)).rank(pct=True)
return ranked.fillna(0.5) - 0.5
def _sector_flag(df, name):
flag = (_sector(df) == name).astype(float)
return flag - flag.mean()
def _terms(df):
return {
"vol_63d": _rank_col(df, "vol_63d"),
"revenue_growth_top": _top_half(_rank_col(df, "revenue_growth_pct")),
"turnover": _turnover(df),
"dollar_volume_21d": _rank_col(df, "dollar_volume_21d"),
"fcf_margin_top": _top_half(_rank_col(df, "free_cash_flow_margin_pct")),
"fam_value": (-0.65 * _zscore_col(df, "forward_pe") - 0.35 * _zscore_col(df, "pe")),
"fam_steadiness": _zscore_series(df, _steadiness(df)),
"fam_growth": (0.55 * _zscore_col(df, "eps_growth_pct") + 0.45 * _zscore_col(df, "revenue_growth_pct")),
"volume_raw": _rank_col(df, "volume"),
"fcf_margin": _rank_col(df, "free_cash_flow_margin_pct"),
}
def eligibility_filter(df):
return ~_sector(df).isin(["Utilities", "Real Estate", "unknown"])
def calculate_score(df):
terms = _terms(df)
score = pd.Series(0.0, index=df.index)
for name, weight in PARAMETERS.items():
if weight:
score = score + weight * terms[name]
score = score.where(eligibility_filter(df), -1e9)
return score.replace([np.inf, -np.inf], np.nan).fillna(0.0)