What TFM Is

TFM is Gecko’s second strategy family, distinct from ORB in a fundamental way: ORB decides everything inside a single trading day, but TFM watches for three separate technical indicators to line up, however many days that takes.

The rule, as understood from Ross Larter’s The Beginner’s Guide to the Stock Exchange (Chapter 5) and confirmed directly with Ross:

  • Stochastic crosses bullish (K crosses above D) while down in the oversold zone (K at or below 20) — this is the signal that first puts a setup on the radar.
  • EMA — the short-period EMA sits above the long-period EMA.
  • MACD — the histogram (MACD line minus signal line) is positive.

A LONG trade fires the first day all three are simultaneously true. There’s no required order between them — stochastic is usually the fastest-reacting of the three in practice, which is why it tends to be noticed first, but that’s an empirical pattern, not a rule the strategy enforces. SHORT is the mirror image: stochastic crossing bearish from overbought (K at or above 80), short EMA below long EMA, MACD histogram negative.

The Bug: “Just Crossed” vs. “Currently Confirmed”

The subtlety, and the thing worth being precise about, is what “confirmed” means for each of the three. Stochastic’s condition really is an event — K crossing D specifically while down in the oversold zone means something distinctive (a reversal turning up from oversold), whereas “K is above D” on its own would stay true through most of an uptrend and wouldn’t mean anything like that.

EMA and MACD are different: they’re states, not events. Whether the short EMA is above the long one, or the MACD histogram is positive, is true or false on any given day regardless of which day it first became true. The earlier implementation treated all three as same-day events — checking whether EMA “just crossed” and MACD “just crossed” on the exact candle being evaluated. That meant EMA and MACD effectively had to cross on the identical calendar day as each other for any trade to ever trigger, because each check only looked at yesterday-versus-today. If EMA crossed on a Monday and MACD didn’t confirm until the following Thursday — with EMA still sitting above the long EMA the whole time — the old code would check Wednesday-versus-Thursday for EMA, find no new crossover there (it already happened days earlier), and block a setup that should have fired.

The fix: EMA and MACD are now checked as same-day states (is the short EMA currently above the long one; is the MACD histogram currently positive), evaluated fresh every day with nothing remembered between days. Stochastic still requires a genuine oversold/overbought crossover — found by scanning back through the available candle history for the most recent qualifying trigger and confirming it hasn’t reversed since — but that’s a backward-looking pure function too, not stored state. A trade fires the first day the scan finds all three conditions true at once, with any gap between when each one individually turned true.

Settings

The same exit-plan machinery as this whole test batch, only the two exit-plan levers below change between runs.

entry.tfm.signal.timeframe=ONE_DAY
entry.tfm.short.ema.period=3
entry.tfm.long.ema.period=15
entry.tfm.stochastic.lookback.period=14
entry.tfm.stochastic.k.smoothing.period=3
entry.tfm.stochastic.d.smoothing.period=3
entry.tfm.macd.fast.period=8
entry.tfm.macd.slow.period=17
entry.tfm.macd.signal.period=9
entry.tfm.stochastic.long.trigger.maximum=20
entry.tfm.stochastic.short.trigger.minimum=80
exit.rewardRisk.ratio=2.0
exit.minimumTargetDistancePercent=0.02

Take-profit target

The take-profit isn’t a fixed distance — it’s the edge of a support/resistance zone detected in the trailing 365 days of price history. supportResistance.strategy controls which detected zone gets used: NEAREST targets the closest zone to entry, SECOND_NEAREST skips one and targets the next, THIRD_NEAREST skips two. A farther zone is a more ambitious target — and, since the stop-loss distance is derived from the target distance divided by the reward:risk ratio (2.0 here), a farther target also means a wider stop.

Trade-expiry window

exit.trade-expiry.days caps how many trading days forward the exit simulation will walk before giving up on a trade and recording a TIMEOUT — neither a win nor a loss, just an inconclusive close-out at whatever price is current then.

Scope

All seven runs below use Gecko’s expanded research scope — a wider, strategy-agnostic basket of 42 LSE-listed stocks, not tied specifically to TFM — over the full available history for each instrument (from 1st September 2016 through 31st August 2026, per-instrument start dates vary where an instrument was listed or backfilled later).

Results

Category Metric THIRD_NEAREST 7d (#145) THIRD_NEAREST 14d (#146) SECOND_NEAREST 7d (#147) SECOND_NEAREST 14d (#148) NEAREST 7d (#149) NEAREST 14d (#150) NEAREST 21d (#151)
Trade Activity Trade plans 4,659 4,659 5,444 5,444 5,189 5,189 5,189
Trades entered 3,674 (78.86%) 3,980 (85.43%) 4,330 (79.54%) 4,673 (85.84%) 4,121 (79.42%) 4,433 (85.43%) 4,596 (88.57%)
Not triggered 985 679 1,114 771 1,068 756 593
Execution Outcomes Take profit 510 (13.88%) 740 (18.59%) 641 (14.80%) 1,038 (22.21%) 990 (24.02%) 1,368 (30.86%) 1,531 (33.31%)
Stop loss 1,156 (31.46%) 1,601 (40.23%) 1,501 (34.67%) 2,113 (45.22%) 1,966 (47.71%) 2,457 (55.43%) 2,707 (58.90%)
Timeout 2,008 (54.65%) 1,639 (41.18%) 2,188 (50.53%) 1,522 (32.57%) 1,165 (28.27%) 608 (13.72%) 358 (7.79%)
Ambiguous 0 (0.00%) 0 (0.00%) 0 (0.00%) 0 (0.00%) 0 (0.00%) 0 (0.00%) 0 (0.00%)
Position Sizes Total position value £11,779,349.85 £12,796,145.77 £14,437,306.64 £15,643,226.49 £19,875,078.69 £21,408,105.59 £22,206,002.83
Largest position value £9,380.31 £9,380.31 £9,380.31 £9,380.31 £9,382.95 £9,386.75 £9,386.75
Average position value £3,206.14 £3,215.11 £3,334.25 £3,347.58 £4,822.88 £4,829.26 £4,831.59
Capital turnover 2,355.87x 2,559.23x 2,887.46x 3,128.65x 3,975.02x 4,281.62x 4,441.20x
Profitability Cross-Check Wins 1,555 (42.32%) 1,722 (43.27%) 1,878 (43.37%) 2,035 (43.55%) 1,715 (41.62%) 1,775 (40.04%) 1,775 (38.62%)
Losses 2,119 (57.68%) 2,258 (56.73%) 2,452 (56.63%) 2,638 (56.45%) 2,406 (58.38%) 2,658 (59.96%) 2,821 (61.38%)
Breakevens 0 (0.00%) 0 (0.00%) 0 (0.00%) 0 (0.00%) 0 (0.00%) 0 (0.00%) 0 (0.00%)
Profit & Loss Gross profit £149,499.73 £192,648.16 £194,136.08 £258,899.87 £232,295.90 £282,382.88 £301,615.85
Gross loss £131,112.16 £166,038.08 £165,034.82 £210,389.97 £195,517.09 £234,570.23 £254,627.52
Profit factor 1.14 1.16 1.18 1.23 1.19 1.20 1.18
Total commission £22,044.00 £23,880.00 £25,980.00 £28,038.00 £24,726.00 £26,598.00 £27,576.00
Average R 0.0525 0.0729 0.0733 0.1144 0.0957 0.1157 0.1085
Net result −£3,656.43 £2,730.08 £3,121.26 £20,471.90 £12,052.81 £21,214.65 £19,412.33

Summary

Fixing the entry-alignment bug alone was enough to flip the baseline from a net loss to net-positive. From there, two independent exit-plan levers — a closer take-profit target and a longer expiry window — each improved results on their own, and combined they multiplied that improvement roughly sevenfold over the corrected baseline, before the expiry window itself found a ceiling.

The baseline configuration (#145, THIRD_NEAREST target, 7-day expiry) is the entry-logic fix and nothing else — same TFM rules described above, run for the first time with EMA and MACD checked correctly as states rather than same-day-only events. It lost money net (−£3,656.43) despite a positive profit factor (1.14), because profit factor is a gross figure and doesn’t account for commission. More than half of every entered trade (54.65%) timed out — neither hit its target nor its stop within a week — which is the real story this batch of tests chases down.

Extending the expiry window to 14 days (#146) converted a large share of those timeouts into genuine decisions: timeout rate dropped to 41.18%, and net result crossed into positive territory (£2,730.08). Independently, tightening the take-profit target from the third-nearest zone to the second-nearest (#147, still 7-day expiry) did almost exactly the same thing by a different route — a closer, more achievable target converts more trades into real outcomes rather than more winners specifically (win rate barely moved, 42.32% → 43.37%), landing at £3,121.26 net.

The two levers compound rather than just add. SECOND_NEAREST + 14-day (#148) reached £20,471.90 net — roughly 6.5× either single-lever result — and NEAREST + 14-day (#150) edged it out slightly at £21,214.65, the best result of the batch. Timeout rate at that configuration falls to 13.72%: 86% of entered trades now resolve to a real win or a real loss rather than an inconclusive close-out. Notably, win rate itself is lower at the best-performing configuration (40.04%) than at the worst-performing one (43.55% at #148) — this result is being carried by decisive resolution, not by picking more winners. A closer target moves the stop closer too (stop distance is derived from target distance ÷ the 2.0 reward:risk ratio), so both take-profit and stop-loss rates rise together as the target tightens.

Patience has a ceiling, though. Pushing the expiry window further, to 21 days (#151), gave back some of that gain — £19,412.33, down from £21,214.65 at 14 days — even though timeout rate kept falling (7.79%, the lowest of the batch) and trade count kept rising. Past 14 days, trades that would have closed as a win earlier in the window apparently reverse and resolve as a stop-loss by day 21 more often than they resolve as a late win: win rate keeps sliding (41.62% → 40.04% → 38.62%) as the window extends from 7 to 14 to 21 days. That’s a genuine peak, not a monotonic “more is always better” trend — which makes it a considerably more trustworthy signal than any single number in this batch would be on its own.

One thing this batch doesn’t establish: whether NEAREST + 14-day is really the best configuration, or just the best of the seven specific points tested. Nothing here rules out a better result at, say, 10 or 12 days, or some target selection between NEAREST and SECOND_NEAREST if that were a tunable continuum rather than three discrete zone choices. NEAREST + 14-day is the new working baseline for TFM going forward — a real, replicated peak rather than a monotonic trend, and one still worth narrowing in on further.