Skip to content
The Casebook · An idea an AI invented

Short after a +12% month, first 3 days of next month

Latest bar is within the first 3 trading days of a new month. The prior calendar month's return for the stock >= +12% and the current close is below the prior month's last close times 1.01 yet the prior month's close was within 3% of the 60-day high. Short at close. Stop = entry + 1.5*ATR(14). Target = entry - 2.5*ATR(14).
Why the AI thought it might work

Month-end rebalancing flows are largest after strong equity months: pensions sell equities to restore bond weights. Stocks that rallied hard that month and sit at monthly highs absorb the selling most, creating predictable weakness in the first days of the next month, visible per stock only when the stock itself had a large month.

VerdictTested Nov 22, 2026

Indistinguishable from luck

It looks positive, but not more than chance would produce at this many tries, or than the same plan on random dates.

  • Positive (+0.066R a trade), but no market clears t > 2.95 by trade and by day.
Trades on the laggards
150

42 large US stocks, 15 years

Per trade, after costs
+0.066R

Before costs +0.151R

Bar to clear
t > 2.95

By trade and by day, sized to 362 rules

What the numbers say

On the 22 laggards the short averaged +0.066R a trade after costs over 150 trades (0.151 before costs), while the 20 winners averaged −0.19R. The gain sits in bull markets (+0.159R, t 1.06 by trade, 0.88 by day); flat was −0.492R and bear −0.011R. No market reaches the 2.95 bar, so it is indistinguishable from luck.

How it was tested

The rule as written, coded once, run on every stock the same way.

Side
Short
Time limit
Exit at the close after 30 trading days, unless the stop, the target or its own exit comes first
Bar to clear
t > 2.95, by trade and by day, sized to the 362 rules in the search it came from
Prices
15 years of daily bars through 2026-11-20; judged 2026-11-22

The evidence

The laggards decide: 22 large stocks that lagged or fell, where hindsight can't flatter a rule. Today's winners sit beside them to show what survivorship would add.

MarketTradesPer tradet, by tradet, by dayRandom datesWinners, per trade
Bull110+0.159R1.060.88 · 81d−0.145R · beats 95%−0.070R
Flat15−0.492R−1.70−1.46 · 14d−0.027R · beats 25%−0.703R
Bear25−0.011R−0.041.22 · 9d−0.071R · beats 70%−0.820R
All150+0.066R−0.121R−0.190R

R is the result per trade in units of the risk taken (entry to stop). Costs are each stock's own trading spread (median 7.3 bps) plus 0.045R for the fills a real order wouldn't get. “By day” groups trades opened the same day, so a rule that fires on the same dates for every stock counts as a few events. “Random dates” places the same plan on random days of the same stocks in the same kind of market, 20 times; the idea must beat 95% of those draws.

The scanner we wroteShow the code
from decimal import Decimal

from core.domain import Bar
from strategies.indicators import atr
from scanners.base import Candidate


class MonthEndWinnerRebalanceFade:
    name = "month_end_winner_rebalance_fade"
    description = "Short last month's 12%+ winners near 60d highs that fail to reclaim the month-end close in the first 3 days of the new month"

    def __init__(self, min_month_ret: float = 0.12, max_new_month_days: int = 3,
                 reclaim_mult: float = 1.01, near_high_pct: float = 0.03,
                 high_lookback: int = 60, stop_atr: float = 1.5,
                 target_atr: float = 2.5) -> None:
        self._min_ret = min_month_ret
        self._max_days = max_new_month_days
        self._reclaim = Decimal(str(reclaim_mult))
        self._near = Decimal(str(near_high_pct))
        self._hl = high_lookback
        self._stop_atr = Decimal(str(stop_atr))
        self._target_atr = Decimal(str(target_atr))

    @staticmethod
    def _ym(b):
        t = b.timestamp
        return (t.year, t.month)

    def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
        n = len(bars)
        if n < 120:
            return None
        cur = bars[-1]
        cur_ym = self._ym(cur)
        # count trading days so far in current month
        k = 0
        i = n - 1
        while i >= 0 and self._ym(bars[i]) == cur_ym:
            k += 1
            i -= 1
        if k < 1 or k > self._max_days:
            return None
        pm_idx = i  # last bar of prior month
        if pm_idx < self._hl + 30:
            return None
        pm_ym = self._ym(bars[pm_idx])
        j = pm_idx
        while j >= 0 and self._ym(bars[j]) == pm_ym:
            j -= 1
        if j < 0:
            return None
        base_close = bars[j].close  # last close of month before prior
        pm_close = bars[pm_idx].close
        if base_close <= 0 or pm_close <= 0:
            return None
        month_ret = float(pm_close / base_close) - 1.0
        if month_ret < self._min_ret:
            return None
        # prior month close near 60-day high (measured through month-end only)
        window = bars[pm_idx - self._hl + 1:pm_idx + 1]
        high60 = max(b.high for b in window)
        if pm_close < high60 * (Decimal("1") - self._near):
            return None
        entry = cur.close
        if entry >= pm_close * self._reclaim:
            return None
        # turn-of-month offset: the stock must be visibly failing today
        rng = cur.high - cur.low
        if rng <= 0:
            return None
        close_pos = float((cur.close - cur.low) / rng)
        bearish = cur.close < cur.open or close_pos <= 0.5
        if not bearish:
            return None
        a = atr(bars, 14)
        if a is None or a <= 0:
            return None
        a_dec = Decimal(str(a))
        stop = entry + self._stop_atr * a_dec
        target = entry - self._target_atr * a_dec
        if target <= 0:
            return None
        risk = stop - entry
        if risk <= 0:
            return None
        rr = (entry - target) / risk
        if rr < Decimal("1.5"):
            return None
        # strength
        ret_score = min(35, max(0, int((month_ret - self._min_ret) / 0.18 * 35)))
        drop_atr = float((pm_close - entry) / a_dec)
        fail_score = min(35, max(0, int((drop_atr + 0.3) / 1.8 * 35)))
        bar_score = int((1.0 - close_pos) * 20) + (10 if cur.close < cur.open else 0)
        strength = max(0, min(100, ret_score + fail_score + bar_score))
        return Candidate(
            ticker=ticker,
            side="sell",
            entry=entry,
            stop=stop,
            target=target,
            risk_reward_ratio=rr.quantize(Decimal("0.01")),
            signal_strength=strength,
            thesis=(f"Gained {month_ret*100:.1f}% last month, closing within {float(self._near)*100:.0f}% of its "
                    f"{self._hl}-day high; on day {k} of the new month it is still below the month-end close "
                    f"and closed weak despite the usual turn-of-month inflow bid, consistent with "
                    f"rebalancing supply hitting last month's winners."),
        )

Hypothetical results from our own backtest of the rule as restated, on 42 large US stocks over 15 years. Past performance, real or simulated, does not predict future results. Research and education only; not investment advice.

Have an idea of your own?

Describe it in plain words and get the same honest test in about a minute.

Run the Gauntlet
Short after a +12% month, first 3 days of next month: Indistinguishable from luck · EdgeProven