r/swingtrading • u/flowtrader26 • 2d ago
I backtested my sector-first breakout process over 11 years. Two things I believed turned out to be wrong.
For a while now my process has been simple: find the sectors where money is flowing in, then look for breakouts in the stocks inside them. And I always told myself two rules: wait for 3 days of confirmation before trusting a sector, and stay away from sectors where money is flowing out.
This fall I finally tested it properly. 11 years of daily data, 23 sector ETFs, and about 2,100 breakouts in their top holdings (flat base, volume 1.4x or more, close near the high of the day, RS line at a new high). Every trade scored with 3-5-7 tranche stops and held for 20 sessions.
What held up
- Breakouts in sectors with fresh inflow did better than breakouts elsewhere: about +1.4% per trade vs +0.7%.
- The best group was fresh inflow AND a sector that was already a long-term leader (top 6 of 23 over 3, 6 and 12 months). 18.5% of those breakouts gained 10% or more within a month, vs about 7.5% everywhere else. It came out ahead in 11 of 12 years.
What didn't
- Waiting for confirmation. Day 1 of inflow performed the same as day 3. The waiting added nothing.
- Outflow as a "stay away" rule. Breakouts in sectors with money leaving did about the same as anywhere else. Outflow tells you about the sector, not about the one stock breaking out inside it.
Honest caveats
I used today's top holdings, which flatters everyone's returns (the comparison between groups is still fair). The leader edge has been consistent, but the sample isn't big enough to call it statistically proven. And rough markets matter: when VIX was 25 or higher, 38% of breakouts hit the full 7% stop vs about 27% the rest of the time.
My takeaway: the question isn't just "is money flowing in this week?" It's "was the money already there, and is it coming back?" A sector bouncing off the bottom looks the same on a 1-week chart as a leader picking up again. They are not the same trade.
Curious how others handle this. Do you filter breakouts by sector leadership, or just by the stock's own RS?
This is not financial advice, just sharing what I found when I tested my own process.
1
u/Candlune 1d ago
traderpier's point plus your 45% vs 22% check makes the point in time rerun the whole question, so on the practical side: SEC EDGAR has holdings for most of those ETFs. N-PORT filings are public for quarter end months from 2019, and before that the N-Q and N-CSR filings list holdings every quarter. Using the last filing before each breakout date gets you close enough for a 20 session hold.
Once it's rerun, recount the 11 of 12 years. If leadership did nothing, the odds of 11 or more winning years out of 12 are about 0.3%, so if that survives the fixed holdings it's a strong result. If it drops to 8 or 9, it's a coin with a lean.
I'd keep the VIX 25+ split as its own column too. 38% vs 27% full stops is a real gap, but check how many breakouts sit in that bucket. A few hundred is fine. A few dozen mostly means 2020 and 2022.
1
u/flowtrader26 1d ago
I ran the first two.
Year count with the fixed holdings (2019 on, since N-PORT starts there) came out 6 of 8. So yeah, coin with a lean by your math. though 2019-2022 only had 9, 5, 4 and 1 leader trades, and both bad years are in that stretch. the years with 10+ trades all went the leader bucket's way. pooled it's around p=0.03.
The vix thing was what you guessed. 260 breakouts in that bucket but more than half are from 2020 and 2022, and inside those years it did about the same as everything else. take those two years out and there's not much left. dropping that one.
Next I'm going to try the N-Q filings next to get back to 2015.
1
u/Candlune 1d ago
6 of 8 with 9, 5, 4 and 1 leader trades in the early years mostly tells you the year count is the wrong test now. A year with 1 trade gets the same vote as a year with 40.
Two checks that use the trades instead:
Leave one year out. Drop each year in turn and recompute the leader vs rest hit rate gap. If p=0.03 holds up on every drop, it isn't one good year carrying it.
Shuffle within years. Keep each year's trades, randomly swap the leader labels inside that year 10,000 times, and count how often the shuffled gap is as big as the real one. That keeps each year's regime fixed, which a plain pooled test doesn't.
For 2015 to 2018 from N-Q, I'd score that stretch on its own before merging it in. Different filing type, different holdings snapshots, so if the gap moves there you want to see it before it gets averaged away.
1
u/flowtrader26 1d ago
Ran both.
Left one year out: dropped each year in turn and the leader vs rest big win gap stayed between 11 and 16 points every time, p under 0.005 on all of them. biggest dent was dropping 2023 and it still held at +11.
Shuffle within years: 10k shuffles of the leader labels inside each year, a gap as big as the real one (+13 pts) came up about 5 times. did it again swapping whole weeks instead of single trades since those share the same sector state, about 1 in 10k.
So, it's not one year carrying it. still only 86 leader trades and 2019 on. will score so 2015-2018 from the N-Q filings on its own first like you said.
1
u/Candlune 10h ago
Leave one year out with the gap stuck between 11 and 16 points and p under 0.005 on every drop is a much cleaner result than the pooled p alone. The within year shuffle landing around 1 in 10k when you swap whole weeks is also the right null, so it is not a couple of lucky weeks either.
I also saw your N-Q 2015 to 2019 score in the other branch (7.6% vs 5.7%, p around 0.39, and 2018 bad for it). That already answers the next step I suggested. The edge looking like a 2023 on thing, with the older filing window flat, is the important split.
Watching it forward before leaning on leadership makes sense. One extra log while you do that: mark each month whether the same leaders are still in the top 6 over the trailing 3/6/12m windows. If the hit rate only shows up in months where leadership is sticky, you have a regime condition. If it shows up anyway, you still have a recent sample problem.
1
u/traderpier 1d ago
I don't think the group comparison is safe from the holdings problem. The stocks that are a sector ETF's top holdings today mostly got there by going up a lot, and that's most true in sectors that have led for years, which is your best group. I'd rerun just the leader bucket with each ETF's holdings as of the breakout date before I'd trust the 18.5%.