CTA Trend Following

Coffee — Concentration, Ensemble & The Twelve Sections

Kaufman's robust-region method on Coffee (KC=F), then the same twelve sections as the market card — all of it on data ending 2015-12-31.

As of 2015-12-31 — the last ten years are withheld. Every number on this tab is computed on bars up to and including 2015-12-31, and nothing after that date is read by any calculation here. The cut happens on the raw price frame before any indicator touches it, so no parameter on this tab was chosen with knowledge of what came next. This market's window is 2000-01-03 → 2015-12-31 (4,003 daily bars). The withheld data still exists and has not been touched — it is the out-of-sample test for whatever comes out of this work, and it is only worth having once the strategies are fixed.
Funded entries
SMA 85, SMA 115, SMA 120
Direction
System A — Long Only
Plateau
SMA 115–120 (2/25 tested)
Efficiency ratio (20d)
0.225
Narrow plateau — treat with caution. The good region covers only 2 of 25 tested periods (8%), below the 20% bar this tab uses to call a region broad. The entries are necessarily close together, so they will move together — the mean pairwise correlation between them is 0.87. This market is excluded from the funded book on the index page.

K1. Where The Results Concentrate

Kaufman's method: rather than take the best of the 50 base cells, or their median, find the contiguous stretch of SMA periods that all work. The plateau is the region holding at or above 70% of the smoothed peak. Its width is the honest measure of how much room for error this market gives you.

Sortino By SMA Period — Where The Results Concentrate

Bars are each tested period on its own. The line averages each period with the tested period either side (3-point neighbourhood), which is what the selection reads. The shaded band is the plateau; the outlined bars are the funded entries.

Plateau
SMA 115–120
Width
2 of 25 tested (8%)
Periods in profit
56% of 25
Best / median / worst
0.29 / 0.03 / -0.53

Why this direction

SystemPlateau meanCoveragePeriods in profit
System A — Long Only0.1738%56%
System B — Long & Short0.0144%24%

The direction is chosen on the plateau, not on the best cell. A direction that covers at least 20% of the grid wins over one that scores higher across three adjacent periods, because that narrow high score is exactly the fluke this method exists to avoid.

Speed preference vs efficiency ratio

Speed bandMean sortino
short(SMA 30–54)-0.248
medium(SMA 55–80)0.028
long(SMA 81–120)0.164

Efficiency ratio over this window: 10d 0.330, 20d 0.225, 60d 0.119. A high ER means price travels in straighter lines, which should favour faster SMAs; a low ER means the path is noisy and a slower SMA should do better. The index page tests that across all markets rather than asserting it here.

K2. The Funded Ensemble — 3 Entries, Equal Weight

Each selected period is funded with 33% of the market's capital and runs as its own base system. They are deliberately spread across the plateau: adjacent periods would be one system counted several times, which is the overfit this is meant to avoid.

EntryBandWeightCAGRMax DDSharpeSortinoCalmarTradesWin rate
SMA 85long33.3%3.8%-45.1%0.160.230.098927.0%
SMA 115long33.3%1.9%-45.9%0.080.120.048134.6%
SMA 120long33.3%4.6%-36.8%0.190.290.136937.7%
Ensemble (equal weight)100.0%3.7%-35.5%0.160.240.10239
Mean pairwise correlation between the members' daily returns is 0.867. The ensemble's Sortino is +0.028 against the average of its members, and its drawdown +0.071 — that difference is the combination working (or not), rather than any member being good.

The ensemble against the three readings it replaces

On sortino, the tab's selection metric.

ReadingsortinoEnsemble minus thisWhat it is
Ensemble0.2403 periods from the plateau, equal weight.
Buy & hold0.022+0.217Holding the future outright over the same window.
Median cell-0.105+0.345The middle of all 50 cells — what picking a parameter at random gets you. This is the reading the earlier cross-market tables used.
Best single cell — SMA 1200.287-0.047The luckiest point on the surface. In sample it must win; the question is by how little, because whatever it wins by is what you are betting survives.

Ensemble Equity — Month-End Cumulative Return

Each funded entry gets 33% of the market's capital and runs independently. Everything stops on 2015-12-31.

Below: the same twelve sections as the market card, rebuilt in-sample. Identical code, identical grids — only the window differs. Use them to see what each risk layer would have done to the funded periods above. Section 13 (Reset / No Reset, added 2026-08-04) is deliberately not here: the client asked for it on the markets “koja imaju sve podatke”, and this tab is the one that does not. The full-history card for Coffee is here — do not read it while choosing parameters.
Instrument
Coffee (KC=F)
History
2000-01-03 → 2015-12-31
Trading Days / Year
252
Volatility Grid
20–60% (step 5)
How this market is calibrated. The volatility factor grid is 20–60%, derived from p10-p90 of annualized 20-day volatility, rounded to a nice step on this market's own history — not Corn's 20–60%, which would be meaningless here. Annualized 20-day volatility percentiles: p5 20.1%, p10 21.9%, p25 26.5%, p50 31.9%, p75 37.4%, p90 44.7%, p95 51.6%. Metrics annualize with 252 trading days per year.

1. Moving Average Optimization

SMA periods 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120. Entry when the SMA turns up, exit when it turns down (System A flat, System B reverses short). Returns are percentages of capital on a compounding equity curve.

Total Return By SMA Period

System A (Long Only) vs System B (Long & Short, stop-and-reverse on the SMA slope). Percentage return on a compounding equity curve.

2. Risk Metrics — Base Systems

CAGR, total return, max drawdown, Sharpe and trade count for every base variant of both systems over 4,003 daily bars. System A = Long Only, System B = Long & Short (stop-and-reverse).

Donchian Breakout — Pure Channel

Lookback N grid 20–80 step 3, then 85, 90, 95, 100. Exit on the opposite N-period band break.

NA: CAGRA: Total ReturnA: Max DDA: SharpeA: SortinoA: CalmarA: TradesB: CAGRB: Total ReturnB: Max DDB: SharpeB: SortinoB: CalmarB: Trades
20-6.4%-65.1%-68.6%-0.25-0.36-0.0956-15.7%-93.3%-94.7%-0.47-0.66-0.17112
23-6.0%-62.6%-70.4%-0.23-0.33-0.0949-14.7%-91.9%-93.6%-0.44-0.61-0.1698
26-6.4%-65.1%-69.1%-0.26-0.37-0.0943-16.0%-93.7%-95.0%-0.48-0.67-0.1786
29-9.3%-78.7%-80.6%-0.38-0.54-0.1241-21.9%-98.0%-98.4%-0.65-0.88-0.2282
32-6.4%-65.2%-73.6%-0.26-0.37-0.0934-16.6%-94.4%-96.4%-0.49-0.68-0.1768
35-4.9%-55.0%-64.9%-0.20-0.29-0.0830-13.3%-89.7%-92.7%-0.40-0.56-0.1460
38-5.0%-55.6%-69.7%-0.20-0.29-0.0727-13.9%-90.6%-94.5%-0.42-0.58-0.1554
41-3.9%-46.8%-64.0%-0.16-0.23-0.0625-11.6%-85.8%-92.0%-0.35-0.49-0.1350
44-2.0%-27.2%-62.2%-0.08-0.12-0.0322-8.8%-76.8%-90.0%-0.27-0.38-0.1044
47-2.6%-33.7%-66.2%-0.10-0.15-0.0421-10.3%-82.2%-93.6%-0.32-0.44-0.1142
50-2.6%-34.3%-70.5%-0.11-0.15-0.0420-11.7%-86.0%-95.3%-0.36-0.50-0.1240
53-2.9%-37.4%-70.5%-0.12-0.17-0.0419-12.2%-87.4%-95.7%-0.38-0.53-0.1339
56-1.7%-23.4%-70.5%-0.07-0.10-0.0218-9.5%-79.5%-93.0%-0.30-0.41-0.1037
59-0.5%-7.4%-64.6%-0.02-0.03-0.0116-7.7%-71.9%-90.4%-0.24-0.34-0.0933
62-0.6%-9.7%-65.2%-0.03-0.04-0.0116-8.0%-73.5%-90.8%-0.25-0.35-0.0933
650.0%0.3%-60.3%0.000.000.0015-6.7%-66.9%-87.8%-0.21-0.29-0.0831
680.0%0.3%-60.3%0.000.000.0015-6.7%-66.9%-87.8%-0.21-0.29-0.0831
710.7%11.2%-56.0%0.030.040.0114-5.9%-62.2%-85.7%-0.18-0.26-0.0729
741.8%32.4%-47.6%0.070.110.0413-3.7%-45.4%-79.1%-0.12-0.16-0.0527
771.1%19.2%-49.2%0.050.070.0213-5.3%-57.8%-80.7%-0.16-0.23-0.0727
800.5%8.1%-44.3%0.020.030.0113-6.8%-67.5%-84.3%-0.21-0.29-0.0827
851.6%29.7%-47.4%0.070.100.0312-4.9%-54.7%-86.0%-0.15-0.21-0.0625
901.2%20.4%-48.3%0.050.070.0212-5.8%-61.1%-87.3%-0.18-0.25-0.0725
950.7%11.5%-49.2%0.030.040.0112-7.0%-68.6%-89.0%-0.22-0.30-0.0825
1002.3%44.2%-51.2%0.100.140.0510-3.0%-38.2%-89.9%-0.09-0.13-0.0321

Moving Average — SMA Slope

SMA period grid 30→70 step 3, then 70→120 step 5. Exit/reverse when the SMA slope flips.

SMAA: CAGRA: Total ReturnA: Max DDA: SharpeA: SortinoA: CalmarA: TradesB: CAGRB: Total ReturnB: Max DDB: SharpeB: SortinoB: CalmarB: Trades
30-3.8%-46.0%-68.6%-0.15-0.22-0.06160-10.7%-83.3%-92.3%-0.32-0.45-0.12320
33-9.2%-78.5%-80.5%-0.37-0.53-0.11174-21.0%-97.6%-98.0%-0.63-0.85-0.21348
36-5.3%-58.0%-60.9%-0.21-0.31-0.09152-14.4%-91.5%-93.3%-0.43-0.60-0.15304
39-4.0%-47.6%-57.6%-0.16-0.23-0.07140-11.7%-86.2%-89.5%-0.35-0.50-0.13280
42-7.2%-69.6%-76.7%-0.29-0.42-0.09164-17.5%-95.3%-96.9%-0.53-0.75-0.18328
45-6.2%-64.0%-73.0%-0.24-0.35-0.09159-15.9%-93.6%-96.4%-0.48-0.68-0.16318
48-2.5%-33.4%-52.9%-0.10-0.15-0.05151-8.5%-75.7%-83.9%-0.26-0.37-0.10302
51-1.2%-17.3%-52.1%-0.05-0.07-0.02139-7.1%-68.8%-82.4%-0.22-0.30-0.09278
540.6%9.6%-59.0%0.020.030.01143-2.7%-35.6%-80.2%-0.08-0.12-0.03287
572.6%50.3%-48.8%0.100.160.051220.3%5.4%-71.9%0.010.010.00245
602.4%45.3%-50.5%0.090.140.051240.7%11.6%-68.4%0.020.030.01249
631.0%17.2%-54.6%0.040.060.02132-2.5%-33.4%-78.3%-0.08-0.11-0.03264
66-2.3%-31.4%-65.8%-0.09-0.14-0.04140-8.9%-77.1%-91.7%-0.27-0.39-0.10280
69-1.6%-23.0%-63.0%-0.07-0.10-0.03129-7.8%-72.6%-87.8%-0.24-0.34-0.09258
700.7%10.9%-45.6%0.030.040.01123-3.9%-46.7%-78.0%-0.12-0.17-0.05246
75-1.5%-21.7%-55.3%-0.06-0.09-0.03108-7.7%-72.1%-86.1%-0.24-0.34-0.09216
802.6%49.5%-40.5%0.110.160.06110-0.6%-9.6%-72.1%-0.02-0.03-0.01220
853.8%82.0%-45.1%0.160.230.09892.5%48.7%-65.0%0.080.110.04178
902.2%41.3%-46.2%0.090.130.0585-1.0%-14.3%-78.1%-0.03-0.04-0.01170
952.0%37.0%-41.6%0.080.120.0582-2.9%-37.1%-75.2%-0.09-0.13-0.04165
1002.8%54.7%-42.8%0.110.170.07830.1%1.2%-64.7%0.000.000.00167
1053.6%76.5%-38.6%0.150.220.09711.7%30.2%-69.1%0.050.080.02142
1100.4%7.0%-45.5%0.020.030.0183-5.5%-59.0%-81.9%-0.17-0.24-0.07166
1151.9%35.3%-45.9%0.080.120.0481-4.0%-47.7%-79.6%-0.13-0.18-0.05162
1204.6%104.8%-36.8%0.190.290.13691.2%20.3%-60.1%0.040.050.02138

2b. EMA-170 Direction Filter On The Donchian Breakout

Client 2026-07-30. The same Donchian channel and N grid as section 2, with one extra precondition: a long may only open while the 170-period EMA is rising, a short only while it is falling. The band break is still required on top, so the filter only removes trades. Exits are untouched. The unfiltered Donchian table in section 2 is the baseline — read them side by side.

Donchian gated by the EMA-170 direction

Same lookback grid as section 2. Compare row for row against the unfiltered Donchian table above.

NA: CAGRA: Total ReturnA: Max DDA: SharpeA: SortinoA: CalmarA: TradesB: CAGRB: Total ReturnB: Max DDB: SharpeB: SortinoB: CalmarB: Trades
20-2.5%-33.2%-56.5%-0.11-0.16-0.0440-10.7%-83.3%-87.5%-0.36-0.50-0.1287
23-0.9%-13.6%-49.0%-0.04-0.06-0.0234-8.2%-74.2%-82.5%-0.27-0.38-0.1075
26-2.2%-29.3%-50.2%-0.10-0.14-0.0432-10.8%-83.8%-90.0%-0.35-0.49-0.1269
29-4.2%-49.2%-63.6%-0.18-0.26-0.0731-16.0%-93.8%-95.7%-0.51-0.69-0.1767
32-1.8%-24.8%-56.2%-0.08-0.11-0.0326-13.7%-90.4%-94.2%-0.43-0.59-0.1559
35-1.9%-26.1%-55.3%-0.08-0.12-0.0324-12.2%-87.4%-92.1%-0.38-0.53-0.1354
38-1.0%-15.4%-58.2%-0.04-0.06-0.0221-11.2%-84.9%-92.8%-0.35-0.48-0.1248
41-0.0%-0.4%-48.5%-0.00-0.00-0.0020-8.8%-77.0%-89.3%-0.27-0.38-0.1045
44-0.2%-3.0%-55.1%-0.01-0.01-0.0019-8.0%-73.3%-88.9%-0.25-0.35-0.0941
47-1.5%-21.2%-59.9%-0.06-0.09-0.0219-10.0%-81.2%-92.8%-0.31-0.43-0.1140
50-1.3%-19.2%-63.7%-0.05-0.08-0.0218-11.1%-84.7%-94.5%-0.35-0.49-0.1238
53-1.6%-22.9%-63.7%-0.07-0.10-0.0318-11.7%-86.0%-94.9%-0.37-0.51-0.1238
56-0.4%-5.7%-63.7%-0.01-0.02-0.0117-8.8%-76.7%-91.4%-0.28-0.39-0.1036
59-0.5%-8.2%-64.9%-0.02-0.03-0.0116-8.2%-74.5%-90.5%-0.26-0.36-0.0933
62-0.7%-10.5%-65.5%-0.03-0.04-0.0116-8.6%-75.9%-90.9%-0.27-0.38-0.0933
65-0.0%-0.6%-60.6%-0.00-0.00-0.0015-7.3%-69.9%-87.9%-0.23-0.32-0.0831
68-0.0%-0.6%-60.6%-0.00-0.00-0.0015-7.3%-69.9%-87.9%-0.23-0.32-0.0831
710.6%10.3%-56.4%0.030.040.0114-6.5%-65.7%-85.8%-0.20-0.28-0.0829
741.7%31.2%-48.1%0.070.100.0413-4.3%-50.4%-79.3%-0.13-0.19-0.0527
771.1%18.2%-49.7%0.040.060.0213-5.5%-59.5%-80.9%-0.17-0.24-0.0727
800.5%8.1%-44.3%0.020.030.0113-7.0%-68.6%-84.3%-0.22-0.30-0.0827
851.6%29.7%-47.4%0.070.100.0312-4.9%-55.0%-86.0%-0.15-0.21-0.0625
901.2%20.4%-48.3%0.050.070.0212-5.8%-61.1%-87.3%-0.18-0.25-0.0725
950.7%11.5%-49.2%0.030.040.0112-7.0%-68.6%-89.0%-0.22-0.30-0.0825
1002.3%44.2%-51.2%0.100.140.0510-3.0%-38.2%-89.9%-0.09-0.13-0.0321

3. Equity Curve Explorer

Pick a period, direction and ATR profit target (or Base) to see its month-end cumulative return, starting at 0%.

Every ATR profit target is overlaid against the base system.

Loading equity curves…

4. Profit Factor Sweep

An ATR profit target swept 1.5 → 10.0 (step 0.5) for every variant. Target = entry ± PF × ATR₂₀, frozen at entry.

Loading profit factor grid…

5. Volatility-Adjusted Profit Target (Dynamic)

The same sweep as section 4, but the target is recomputed each day from the current ATR instead of frozen at entry, so it breathes with volatility while staying anchored to the entry price.

Loading profit factor grid…

6. Stop Loss Sweep

A protective ATR stop swept 1.5 → 10.0 (step 0.5). Stop = entry ∓ SL × ATR₂₀, no take-profit; the position still reverses on the opposite SMA-slope signal if the stop is not hit first.

Loading stop loss factor grid…

7. ATR Trailing Stop Sweep

A trailing ATR stop, distinct from section 6: stop = best price reached since entry ∓ f × ATR₂₀, recomputed daily. It ratchets in the trade's favour and retreats when volatility rises. Swept 1.0 → 10.0 (step 0.5).

Loading trailing factor grid…

8. Stop Loss + Time Stop — Equity Curves

The full strategy: SMA entry, ATR stop loss, and a time stop that exits a trade still not in profit 5/10/15/20/30/40 days after entry. Split into one file per SMA period so this loads in a fraction of the Corn page's payload.

Loading equity curves…

9. Time Stop Only — Equity Curves

The time stop judged on its own, with no ATR stop, against the plain SMA baseline. Each line exits a trade still underwater 5/10/15/20/30/40 days after entry.

Loading equity curves…

10. Volatility Filter Sweep

Volatility is the annualized standard deviation of daily returns — the standard deviation of the last 20 daily returns × √252. The factor is a maximum: a new position opens only on a day at or below it, so the strategy stands aside in turbulence. An open trade is never closed by the filter.

Loading volatility factor grid…

11. Volatility Filter + ATR Trailing Stop

The first combined risk layer: the section-10 filter and the section-7 trailing stop in one strategy, swept together across every combination. The last column is section 7 on its own, so you can read left to right whether adding the filter helps.

Loading the volatility × trailing-stop grid…

12. Volatility Regime Switch

The same threshold as section 10, but acting as a regime switch: above it the open position is closed at that day's close, nothing opens while volatility stays high, and the position re-opens on the first calm day the SMA slope still points the right way — no fresh signal required.

Loading volatility factor grid…

Source: Yahoo Finance daily OHLC, truncated at 2015-12-31 — nothing after that date was read by any calculation on this page. Generated 2026-08-03 05:33:31 UTC.