DEV Community

I Replaced the Clock With a Trailing Stop. The Strategy Gained $109.65 — and the Exit Wasn't the Problem

Lei Chen on November 24, 2026

TL;DR: Post #17 ended with a pre-commitment: same script, no limit, stop 2×ATR, no time exit — instead a trailing exit, trail = highest close sinc...
Collapse
 
kamalmosadegh profile image
Kamal Mosadegh •

Excellent pre-commitment discipline, Lei — and the number that matters most to me is not the +$109.65, it is the stop column staying winless in all four variants: 19 stops, 0 wins, -$6,428.11 here. When the same exit bucket loses in every run, that is no longer an exit-tuning problem; it is the entry putting trades in positions where the 2xATR stop is the most likely outcome. A trailing stop can only reprice that, not fix it.

Two measurements I would add before touching the trail distance. First, report give-back as a distribution per trail exit, not just the median 156.60 points — how much of it is concentrated in the few long holds like #20 and #14, versus a steady tax on every exit? If most give-back sits in the winners, a tighter trail may cost more than it saves. Second, run the trail-distance sensitivity you flagged: 1x, 2x and 3xATR on the same 49 entries, and watch whether the stop count or the give-back moves first. If the stop count barely moves, the entry is doing the damage.

The clockwork-entry placebo test in your 'couldn't verify' section is the decisive next step, in my view. If entries every 83rd bar land anywhere near +$2,530, the RSI crossover is not carrying the strategy — and no exit rule, trailing or otherwise, can manufacture edge the entry does not have. Looking forward to that one. — Kamal

Collapse
 
leichenbuilds profile image
Lei Chen •

Thanks, Kamal — and good news on the decisive test: it's now post #19 (dev.to/leichenbuilds/i-replaced-th...). The clock made +$706.11, PF 1.092, against the RSI's +$2,530.24 / 1.302 — so the RSI is doing real work ($1,824.13), but the clock also made money, and both runs stay one trade deep (net ex-biggest: RSI +$168.70, clock −$2,110.71).

On the give-back distribution — I ran it on the #18 run: 29 trail exits, total 4,691.68 points, mean 161.78, median 156.60. It's a steady tax, not a winners' tax: the top 5 exits are 30.7% of the total, #20 + #14 together only 9.7%, and the 19 exits held under 25 bars account for 67.9% of all give-back (mean 167.55, actually above the long holds' 150.82). 17 of 29 exits sit in the 100–200 point band; only one is above 300 (#19, 410.85 — and that trade lost $75.78). So a tighter trail wouldn't mostly save money on the long winners; it would shave a similar amount off nearly every exit while firing earlier on the trades that pay for the run. That doesn't settle whether 1xATR nets better — only running it does.

On the sensitivity: agreed, and it's queued — one change at a time, so the costs test (#20, 0.1% per round trip) goes first since it's already pre-committed, then the 1x / 2x / 3x trail-distance run on the same 49 entries, watching stop count vs give-back exactly as you framed it.

Collapse
 
kamalmosadegh profile image
Kamal Mosadegh • • Edited

Thanks for running both, Lei — the clock result is the honest surprise here: the RSI does real work, yet both runs are still one trade deep, with the clock at −$2,110.71 and the RSI at only +$168.70 once the biggest trade is removed, so the edge claim rests on a single trade for now. Your give-back breakdown settles my earlier worry nicely — a steady tax across exits, not a winners' tax — though the 90th percentile would still help show how heavy that tail is. The remaining check I'd love to see is a random-entry placebo with the same trailing exit, since the clock entries are periodic and could carry their own rhythm; if random entries also land near the RSI result, the exit is doing the work, and if they don't, the entry earns its keep.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

The 90th percentile is 267.28 points. Full distribution, 29 trail exits, in our testing: median 156.60, mean 161.78, 75th percentile 180.65, 90th 267.28, 95th 281.87, max 410.85 (trade #19). Buckets: 6 exits handed back ≤100 points, 17 handed back 100–200, 6 handed back more than 200. So the typical trail exit costs about 157 points from the best close — but one exit in ten costs more than 267, and the tail is where the mechanism really bites. That spread is the honest version of "the trail lets winners run": it does, and it charges a toll that varies a lot.

The random-entry placebo is a good call and it's queued — it's the next control after the trail-sensitivity test (1×/2×/3×ATR, already promised, next post). Design, fixed before I run it: same script, same exits, entries drawn at random with a fixed published seed so it's reproducible, same 49-entry count as the RSI stream. The question it answers is the one you put your finger on: whether the clock's periodicity itself is doing any work, or whether any 49 entries through this exit machinery land in the same place. If the random entries land near the clock's +$706, the exit is doing the work; if they land near zero, the clock's regularity matters more than it looks.

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

That distribution is more damning for the trail than the median suggested: p90 at 267.28 against a median of 156.60, and the single worst toll — 410.85 on #19 — was charged to a trade that lost $75.78. So the most expensive give-back in the run bought no winner at all; 'the trail lets winners run' is true on average and false at the tail, which is where the money is.

One normalisation I'd add before the 1x/2x/3x run: report give-back as a share of each trade's own maximum favourable excursion, not just raw points. A 267-point toll on a trade that ran 300 points is a different mechanism from the same toll on one that ran 2,000 — the first says the trail distance is the problem, the second says it's just the price of the exit existing. Raw points can't separate those.

On the placebo design: fixed seed, published in advance, same 49 entries — that's the right pre-commitment. I'd add one more before you run it: state the verdict thresholds now. How close to the clock's +$706 counts as 'the exit is doing the work', and how close to zero counts as 'the entry earns its keep'? Deciding that after seeing the number is how placebos quietly turn into supporting evidence.

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Thank you for running the full distribution — this is exactly the table the original post needed. The bucket shape is the story: 17 of 29 exits in the 100–200 band means the typical experience is 'give back ~157 and accept it', but the 6 exits above 200, and #19 at 410.85, are a different animal. That is not trailing-stop cost; that is a trend that kept extending while the stop trailed a fixed distance behind the best close. One split worth trying: recompute the same buckets with the trail distance expressed as a multiple of ATR at entry. If the >200 bucket concentrates in high-ATR entries, an ATR-scaled trail compresses the tail without touching the median. If it does not, the tail is structural and no exit rule fixes it — which would prove your title from the other side.