DEV Community

Lei Chen
Lei Chen

Posted on

The Same Losing Strategy Made $3,153 on Weekly Bars. Twelve Trades Say Don't Believe It.

TL;DR: Post #11 ended with a question: does the RSI mean-reversion bracket survive a timeframe change? Same script, same symbol, zero code changes — only the feed switched from 4,089 daily bars to 862 weekly bars. The strategy flips from -$2,572.67 (PF 0.587) to +$3,152.52 (PF 2.235). But it only traded 12 times in 16 years, and one trade — a single week in late September 2024 — made $1,937.34, 61.5% of the entire net. The flip is real, and it is not a finding.

Daily (#5 / #11) Weekly (this post)
Bars 4,089 (2010-01-04 → 2026-11-06) 862 (2010-01-08 → 2026-11-06)
Closed trades 58 12
Net profit -$2,572.67 +$3,152.52 (+31.53%)
Profit Factor 0.587 2.235
Win rate 19 / 58 (32.8%) 6 / 12 (50%)
Avg hold 3.6 bars 3.6 bars
Buy & hold, same span +$1,468.22 (+14.68%) +$1,649.79 (+16.50%)

The setup: one feed changed, nothing else

The script is post #5's fixed version, byte-identical — the compiled .py for this run diffs clean against the daily run's output, zero diagnostics from the local compiler. The only difference is the feed: the weekly bars of the same CSI 300 index, 862 bars, same $10,000, same PyneCore patched runtime, no commission, no slippage. The exit is still price levels, not tick distances:

if inTrade
    entryPrice = strategy.position_avg_price
    strategy.exit("Exit Long", "Long", limit=entryPrice + atrVal * 2, stop=entryPrice - atrVal)
    if barsInTrade >= maxHold
        strategy.close("Long", comment="Time exit")
Enter fullscreen mode Exit fullscreen mode

The question is never "does it run on weekly bars" — of course it runs. The question is whether the exit logic means the same thing when one bar is a week instead of a day. A 2×ATR limit and a 1×ATR stop are priced in points, and a weekly bar's ATR is a different animal from a daily bar's. Same code, different contract.

What you're checking here:

  • Does the strategy actually get better on weekly bars, or does the trade count just collapse?
  • How much of the weekly profit is one trade?
  • What does the bracket do differently when each bar carries five days of movement?

Probe 1: the flip is real — and the sample is twelve

Daily Weekly
Trades (closed) 58 12
Net profit -$2,572.67 +$3,152.52
Gross profit / gross loss — / — $5,704.65 / $2,552.13
Profit Factor 0.587 2.235
Win rate 32.8% 50% (6 / 12)
Avg win / avg loss — +$950.78 / -$425.36
Avg hold, winners / losers — 5.7 bars / 1.5 bars
Max equity drawdown — $1,148.21 (10.52%)
Buy & hold +$1,468.22 +$1,649.79

The weekly version beats buy & hold by roughly 2× (+31.53% vs +16.50%) while the daily version lost money against the same benchmark. On the headline numbers, the timeframe change looks like it fixed the strategy.

Then count the trades. Twelve, over sixteen years. Six winners, six losers. A 50% win rate on twelve trades has a confidence interval wide enough to drive a truck through — flip two trades and the story reverses. And the entry rate per bar is nearly identical on both feeds (12 signals in 862 weekly bars vs 58 in 4,089 daily bars, ~1.4% of bars in both cases): the signal didn't get rarer per bar, there are just five times fewer bars. The strategy didn't get smarter. It got fewer chances to be wrong — and fewer chances to be right.

There is also a six-year silence in the middle: no entry at all between 2012-02-24 and 2018-07-20, and nothing after 2024-09-27. A strategy that trades twelve times in sixteen years and sleeps for six of them is not a strategy you can evaluate on its equity curve; it is a strategy you evaluate on its individual trades. So let's do that.

Probe 2: one trade is 61.5% of the net

The twelve trades, in order:

# Entry Exit Bars Result How it exited
1 2010-07-16 2010-08-20 5 +$918.06 Bracket
2 2011-10-21 2011-10-28 1 -$567.56 Bracket
3 2011-11-04 2011-11-25 3 -$389.85 Bracket
4 2012-01-20 2012-02-24 4 +$981.20 Bracket
5 2018-07-20 2018-08-03 2 -$418.26 Bracket
6 2022-04-08 2022-04-15 1 -$352.06 Bracket
7 2022-05-27 2022-07-01 5 +$702.06 Bracket
8 2022-11-11 2023-01-13 9 +$591.94 Bracket
9 2024-01-05 2024-01-12 1 -$310.98 Bracket
10 2024-02-02 2024-02-08 1 -$513.42 Bracket
11 2024-02-23 2024-04-30 10 +$574.05 Time exit
12 2024-09-27 2024-09-30 1 +$1,937.34 (+20.18%) Bracket

Trade #12 entered 2024-09-27 and exited one weekly bar later, +20.18% — the late-September 2024 stimulus rally week, when the whole index ripped. That single bar is $1,937.34 of the $3,152.52 net. Remove it and the weekly net falls to +$1,215.18; remove it from the bracket exits and their net falls from +$2,578.47 to +$641.13. The "weekly version wins" headline is, to first order, a headline about one week in September 2024.

The rest of the table is less flattering than the PF suggests. Four of the six losers exit after a single bar — the 1×ATR stop gets hit almost immediately, at -$311 to -$568 a time. The winners take their time (5.7 bars on average vs 1.5 for losers), which is the one genuinely good shape in the data: the bracket lets winners run and cuts losers fast. But with six winners, that shape is a description of six trades, not a property of the rule.

And the time exit — the hero of post #5, the subject of post #11's whole sensitivity check — fired exactly once in twelve trades (+$574.05, trade #11, the only trade that survived the full 10-bar cap). Post #11 concluded the cap barely matters on daily bars; on weekly bars it matters even less, because almost nothing survives ten weeks. The maxHold debate from #11 is closed by this run, not by argument: the rule fired once.

Probe 3: what the bracket actually does on weekly bars

The average hold is 3.6 bars on both feeds — the same number, a different duration. On daily bars that's 3.6 days; on weekly bars it's 3.6 weeks, roughly 18 trading days. The bracket's distances are priced in ATR points, and weekly ATR is far wider than daily ATR, so the 2×ATR limit sits much further from the entry in price terms. The strategy holds through moves that would have stopped it out on daily bars, and when the stop does hit, it hits after a full week of adverse movement — hence losers averaging -$425 while daily losers were smaller and more frequent.

Where weekly shines: fewer, slower trades; the bracket's asymmetry (winners 5.7 bars, losers 1.5) finally shows up instead of being drowned in 58 noisy exits; the strategy beats buy & hold instead of losing to it.

Where weekly hurts: twelve trades is not a sample, it's a list. One week is 61.5% of the profit. A six-year gap with no signals means the strategy is untestable for most of the sample. And the same code that lost -$2,573 on daily bars "wins" here — which means the timeframe, not the logic, is doing the work, and the timeframe was picked after seeing the daily result. That is selection, and it should be labeled as such.

What to check before you trust a timeframe change

  1. Count the trades first, read the equity curve second. Twelve trades cannot support a PF of 2.235 as a claim. The headline number is the least informative cell in the table.
  2. Find the biggest trade and remove it. If the verdict changes when one trade leaves, the verdict belongs to that trade. Here it doesn't flip the sign (+$1,215.18 without #12) — but it cuts the net by 61.5%, and that deserves to be in the first paragraph, not a footnote.
  3. Check the hold in calendar time, not bars. "3.6 bars" sounds identical on both feeds. It is 3.6 days on one and 3.6 weeks on the other. Any exit priced in points (ATR multiples, fixed stops) changes meaning when the bar widens.
  4. Check whether the rule you argued about still exists. The maxHold cap fired once in twelve trades. A sensitivity check on a rule that fires once is a check on one trade.
  5. Say which decision was made after seeing the result. The weekly test was chosen because the daily version lost. That doesn't invalidate it, but it means this is an exploration, not a confirmation — and it needs a second symbol or a second timeframe to become one.

Rules I now follow

  1. A timeframe flip is a new strategy until proven otherwise. Same code, different bar width, different exit distances in points, different hold in days. Test it as if you had never seen the daily result.
  2. One trade over 50% of the net gets named in the headline paragraph. Not buried in a table. If a single week made the strategy, the reader should know before the equity curve.
  3. Report the gap, not just the trades. Six years with no signal is data: it tells you how often the strategy is even in the market.
  4. "Beats buy & hold" needs the trade count next to it. +31.53% vs +16.50% sounds like a verdict. With 12 trades, it is a suggestion.

What this post gives you, and what it doesn't

This post gives you: the same script on weekly bars, trade by trade, with the one-trade dominance measured (+$1,937.34 of +$3,152.52) — plus a five-point checklist for any timeframe change you run yourself (count trades first, remove the biggest one, convert bars to days, check the rule still fires, label post-hoc choices).

This post does not give you: a verdict on weekly RSI mean reversion, or on this strategy. Twelve trades, one symbol, no costs — that is enough to retire the idea that "weekly fixes it", not enough to claim weekly works. It also does not test whether a different cap, a different RSI length, or a different symbol would change the answer; each of those is its own post, and each would need to be chosen before seeing the result.

Next in the series: the bracket itself under the microscope — on the daily feed, how often does the 2×ATR limit fire first versus the 1×ATR stop, and what does the exit split look like when the limit widens? Same script, no new code, just counting what the exit actually does.


What timeframe change flipped one of your strategies from losing to winning — and how many trades was it really? I read every comment — the measurement stories are what the next posts are built from.


This conversion work was done by Pine2Py, the tool I build for exactly this job: paste a Pine script, get PyneCore-flavored Python back, diagnostics included when something can't be translated. The runtime is the open-source PyneCore project, with a patched build we ship for the two constructs stock PyneCore doesn't handle — details are on the site. It's free to try — every account gets 3 conversions, no card — and Pro is $12/month if you end up converting a whole library. No return promises, ever: a translator moves your logic, it doesn't make it profitable.

Top comments (0)