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 1978-12-14 → 2015-12-31 (9,285 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.

1.00% of current equity at risk per trade · contracts = equity × 1.00% ÷ (20-day ATR × point value), rounded down to whole contracts · $1,000,000 start, profits reinvested

Funded entries
SMA 54, SMA 66, SMA 75, SMA 95
Direction
System B — Long & Short
Plateau
SMA 48–105 (16/25 tested)
Efficiency ratio (20d)
0.236

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 48–105
Width
16 of 25 tested (64%)
Periods in profit
100% of 25
Best / median / worst
0.70 / 0.49 / 0.14

Why this direction

SystemPlateau meanCoveragePeriods in profit
System A — Long Only0.45260%100%
System B — Long & Short ✓0.52964%100%

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.429
medium(SMA 55–80)0.525
long(SMA 81–120)0.418

Efficiency ratio over this window: 10d 0.333, 20d 0.236, 60d 0.137. 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 — 4 Entries, Equal Weight

Each selected period is funded with 25% 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 54short25.0%6.0%-54.6%0.450.700.1145835.8%
SMA 66medium25.0%5.3%-60.4%0.410.630.0948333.3%
SMA 75medium25.0%3.3%-67.2%0.290.430.0544328.2%
SMA 95long25.0%4.2%-50.1%0.360.530.0836233.4%
Ensemble (equal weight)100.0%4.5%-55.9%0.400.610.081746—
Mean pairwise correlation between the members' daily returns is 0.792. The ensemble's Sortino is +0.040 against the average of its members, and its drawdown +0.022 — 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, at the 1% default risk the selection is made at (the table above and the chart below follow the sizing chosen at the top).

ReadingsortinoEnsemble minus thisWhat it is
Ensemble0.615—4 periods from the plateau, equal weight.
Buy & hold-0.071+0.685Holding the future outright over the same window.
Median cell0.423+0.192The 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 540.702-0.087The 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 25% of the market's $1,000,000 as its own sub-account, sized in whole contracts off its own equity at the chosen sizing (under the old sizing, the entries' daily returns are averaged, as before). Each member line is that entry alone on the whole account. Buy & hold is an unleveraged holding of the price. Everything stops on 2015-12-31.

Loading curves…

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
1978-12-14 → 2015-12-31
Trading Days / Year
252
Volatility Grid
15–55% (step 5)
All results are net of trading costs. Every round turn (entry + exit) of one contract pays $5.00 commission + 1.5 ticks of slippage (1.5 × $18.75) = $33.13, i.e. 0.08833 price points at $375 per point, times the trade's contract count. Half is charged on entry and half on exit (a position still open at the end has paid only its entry half), so it weighs more on short, frequent trades. Profit Factor is gross profit ÷ gross loss over the trades the account took (not the ATR target multiple sections 4–5 call “profit factor”); Avg Trade and Avg Loss are net account dollars at the chosen sizing. Contract rolls are not charged as extra round turns.
Position sizing: ATR risk on a compounding $1,000,000 account, whole contracts. Every trade buys equity × risk ÷ (20-day ATR at entry × point value) contracts, rounded down to a whole contract, where equity is what the account holds when the trade opens — so profits are reinvested and losses shrink the next position. A trade that rounds down to zero contracts is not taken; the account stays flat through it. Risk is the setting at the top of the page, 0.25% to 5% (default 1%): it sets the position size from one ATR, while the exit is whatever the strategy's own rules say (the opposite signal, or the ATR stop of the sections that have one). Below 5% the same setting offers the sizing used until 14 October 2026 — the whole account in the contracts' notional value, compounding. Every CAGR, drawdown, ratio, trade count, average trade and equity curve follows the setting. Sharpe and Sortino are the annualized mean daily return over its volatility and downside deviation. Points per contract (total profit, long/short split) do not depend on the sizing. Buy-and-hold is a plain, unleveraged holding of the price.
How this market is calibrated. The volatility factor grid is 15–55%, 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 13.9%, p10 16.5%, p25 23.0%, p50 29.5%, p75 37.7%, p90 49.3%, p95 58.1%. Metrics annualize with 252 trading days per year. A cell at −100% CAGR means the $1,000,000 account was wiped out at the chosen sizing: it went to zero, and the account stops there. History from 1978-12-14: this card now runs on Norgate's Panama-adjusted series, which for most markets starts in 1978–1983 — years or decades before the feeds this site used earlier (1998–2019, depending on the market). Trend results include the 1980s–90s trends and buy-and-hold includes decades of roll cost, so neither is comparable to figures from those earlier feeds.

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 on the $1,000,000 account, every trade sized as chosen above, profits reinvested.

Total Return By SMA Period

System A (Long Only) vs System B (Long & Short, stop-and-reverse on the SMA slope). Total return on the $1,000,000 account at the chosen sizing.

2. Risk Metrics — Base Systems

CAGR, total return, max drawdown, Sharpe, trade count, profit factor and the average trade / average losing trade for every base variant of both systems over 9,285 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: TradesA: Profit FactorA: Avg TradeA: Avg LossB: CAGRB: Total ReturnB: Max DDB: SharpeB: SortinoB: CalmarB: TradesB: Profit FactorB: Avg TradeB: Avg Loss
201.4%69.8%-66.1%0.180.270.021161.14$6,021−$58,2302.2%125.9%-73.2%0.230.340.032311.10$5,449−$81,886
231.2%54.5%-60.7%0.160.240.02991.14$5,503−$54,3712.1%112.1%-65.6%0.210.320.031971.12$5,689−$70,066
261.6%82.1%-60.8%0.190.300.03871.21$9,432−$60,2492.4%136.9%-68.2%0.230.360.031731.16$7,915−$76,750
291.8%95.5%-59.7%0.200.320.03751.25$12,727−$72,0292.7%166.0%-66.8%0.250.390.041491.19$11,143−$91,787
321.8%93.5%-58.9%0.200.310.03681.27$13,751−$72,9272.8%178.5%-63.6%0.260.400.041361.25$13,128−$85,522
351.4%69.4%-59.8%0.170.270.02631.23$11,013−$70,8952.3%131.6%-64.5%0.230.340.041261.22$10,442−$78,113
381.3%62.2%-61.6%0.160.250.02591.21$10,534−$69,0871.9%98.1%-67.4%0.200.300.031181.19$8,315−$69,616
411.6%77.7%-61.4%0.180.280.03531.27$14,663−$74,5862.4%135.4%-69.9%0.230.350.031061.25$12,770−$79,083
441.9%99.2%-58.8%0.210.320.03481.35$20,668−$81,2743.1%213.2%-65.4%0.280.430.05961.37$22,204−$93,684
471.8%96.5%-60.9%0.200.310.03451.34$21,443−$86,1902.8%180.7%-69.9%0.260.400.04901.31$20,079−$103,164
502.2%126.7%-58.6%0.230.360.04401.45$31,665−$97,7363.5%253.7%-69.9%0.300.460.05801.37$31,708−$134,720
532.4%138.5%-57.5%0.240.380.04381.49$36,461−$101,3153.7%287.6%-68.0%0.320.480.06761.39$37,844−$144,438
562.3%131.3%-55.5%0.240.370.04371.49$35,478−$95,1663.7%286.9%-64.6%0.320.480.06741.41$38,765−$138,824
592.1%116.0%-55.8%0.230.340.04361.44$32,227−$98,1473.4%243.8%-64.5%0.300.450.05721.37$33,859−$135,516
622.1%118.5%-57.6%0.230.350.04351.44$33,855−$103,8043.3%231.3%-67.4%0.290.440.05701.35$33,044−$139,777
652.0%110.7%-57.0%0.220.340.04341.44$32,555−$100,3233.0%200.3%-68.0%0.270.410.04681.33$29,450−$131,409
681.7%89.3%-58.3%0.200.300.03341.37$26,262−$95,8642.4%139.9%-70.2%0.230.350.03681.26$20,577−$118,501
711.3%58.7%-58.8%0.160.250.02341.27$17,255−$87,8341.5%74.2%-71.4%0.180.260.02681.16$10,914−$95,868
741.4%67.2%-56.9%0.170.260.02321.32$20,992−$91,2902.0%104.6%-69.6%0.200.300.03641.22$16,348−$113,264
771.2%55.7%-56.8%0.160.240.02321.27$17,415−$90,7531.6%80.3%-69.7%0.180.270.02641.17$12,543−$108,380
801.6%76.3%-58.5%0.180.280.03301.39$25,422−$92,3291.9%97.4%-72.2%0.200.290.03601.22$16,225−$111,882
852.0%109.0%-55.6%0.220.330.04271.61$40,372−$98,9622.9%185.8%-63.9%0.270.400.05541.42$34,399−$130,470
901.7%83.5%-54.4%0.190.290.03271.52$30,939−$89,3322.3%134.1%-64.4%0.230.340.04541.35$24,833−$114,099
951.6%78.1%-52.6%0.190.290.03261.51$30,056−$90,0742.0%110.2%-63.1%0.210.310.03521.30$21,193−$114,437
1001.1%52.1%-52.7%0.150.230.02251.39$20,825−$82,7501.6%80.3%-64.8%0.180.270.02501.26$16,055−$98,943

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: TradesA: Profit FactorA: Avg TradeA: Avg LossB: CAGRB: Total ReturnB: Max DDB: SharpeB: SortinoB: CalmarB: TradesB: Profit FactorB: Avg TradeB: Avg Loss
301.3%60.9%-56.5%0.170.250.023611.13$1,686−$18,5921.8%92.5%-60.8%0.190.290.037221.09$1,282−$19,995
331.8%96.0%-63.5%0.210.320.033431.16$2,797−$24,4292.8%181.0%-69.6%0.260.400.046851.12$2,643−$32,641
361.4%64.9%-65.8%0.170.260.023301.12$1,965−$22,6781.6%76.7%-73.5%0.180.270.026591.06$1,164−$25,694
392.2%124.3%-62.7%0.240.370.043151.22$3,945−$25,3573.1%210.5%-68.9%0.280.430.056291.16$3,346−$30,684
421.7%82.9%-64.7%0.190.300.032971.16$2,791−$23,3192.2%119.7%-73.0%0.220.330.035931.11$2,018−$24,555
451.7%86.6%-61.3%0.200.310.032951.19$2,937−$22,0662.0%109.3%-71.7%0.210.320.035891.13$1,855−$20,999
482.7%169.1%-55.9%0.270.430.052641.32$6,406−$29,6184.1%342.3%-62.2%0.340.520.075271.24$6,495−$39,376
513.5%249.9%-45.7%0.330.520.082531.50$9,877−$29,0934.9%482.2%-48.2%0.390.600.105061.41$9,529−$34,761
544.2%349.1%-49.9%0.380.600.082291.65$15,245−$33,8216.0%746.3%-54.6%0.450.700.114581.53$16,295−$47,786
573.4%238.5%-47.8%0.320.510.072411.57$9,894−$24,8044.9%479.5%-49.2%0.390.600.104821.50$9,949−$30,869
602.3%132.9%-62.5%0.240.380.042631.27$5,054−$26,9032.8%178.8%-72.3%0.260.390.045261.17$3,399−$29,923
633.0%197.3%-57.1%0.290.460.052731.40$7,227−$24,5584.2%352.1%-63.2%0.340.520.075451.32$6,460−$29,257
663.6%272.4%-54.0%0.340.530.072421.48$11,258−$33,3435.3%575.2%-60.4%0.410.630.094831.38$11,909−$47,486
693.2%217.2%-48.9%0.300.470.072351.42$9,244−$30,7274.7%436.8%-52.4%0.370.570.094691.32$9,314−$42,046
703.0%198.1%-54.2%0.290.450.062341.42$8,466−$28,5514.2%354.1%-62.2%0.340.520.074671.31$7,583−$35,203
752.4%142.9%-57.0%0.250.390.042221.36$6,435−$25,0323.3%228.8%-67.2%0.290.430.054431.23$5,165−$30,705
803.2%220.1%-55.0%0.300.470.061951.52$11,286−$31,7214.3%367.8%-66.2%0.350.530.063891.34$9,454−$41,632
852.5%150.7%-59.4%0.260.400.042031.41$7,424−$24,9953.8%300.9%-71.1%0.330.490.054061.31$7,410−$32,710
902.7%162.7%-48.1%0.270.410.061841.56$8,842−$24,0134.2%349.0%-53.1%0.350.520.083671.51$9,511−$27,772
952.6%161.7%-46.0%0.270.420.061811.61$8,932−$22,0124.2%359.9%-50.1%0.360.530.083621.51$9,942−$29,125
1002.8%180.9%-50.6%0.280.430.061751.56$10,336−$27,1654.7%436.7%-58.9%0.380.570.083501.48$12,478−$40,308
1051.5%76.1%-55.0%0.190.290.031541.35$4,941−$21,2703.1%203.4%-64.9%0.280.420.053081.31$6,605−$31,429
1101.4%65.4%-55.7%0.170.260.021561.28$4,194−$21,3202.6%154.5%-67.2%0.250.370.043121.23$4,951−$30,616
1151.0%42.9%-55.7%0.140.210.021481.22$2,901−$18,5292.1%111.9%-60.4%0.210.310.032961.22$3,779−$24,656
1200.1%3.9%-62.1%0.070.100.001551.02$252−$15,7010.3%13.4%-71.9%0.090.140.003101.03$431−$18,472

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: TradesA: Profit FactorA: Avg TradeA: Avg LossB: CAGRB: Total ReturnB: Max DDB: SharpeB: SortinoB: CalmarB: TradesB: Profit FactorB: Avg TradeB: Avg Loss
201.7%89.2%-60.5%0.210.320.03841.26$10,618−$58,1242.9%190.3%-69.6%0.290.430.041801.18$10,573−$90,949
231.4%69.0%-60.6%0.180.280.02741.24$9,322−$56,8082.4%135.9%-68.7%0.240.360.031591.17$8,546−$78,879
261.7%83.9%-60.8%0.200.310.03691.29$12,159−$55,2562.4%142.3%-69.3%0.240.370.041451.19$9,813−$76,241
292.0%105.7%-57.9%0.220.340.03601.37$17,612−$62,7532.9%185.6%-65.6%0.270.420.041281.26$14,498−$86,659
321.8%93.8%-55.5%0.200.320.03561.35$16,745−$63,8513.3%229.6%-61.0%0.300.460.051171.34$19,627−$90,558
351.5%71.6%-59.6%0.180.280.02531.29$13,518−$61,4802.6%157.8%-64.2%0.250.380.041111.28$14,220−$79,482
381.5%75.0%-60.3%0.180.280.03501.30$14,992−$70,1272.1%112.3%-66.8%0.210.320.031061.22$10,593−$73,751
411.9%102.1%-59.6%0.210.330.03451.40$22,682−$75,4472.5%146.7%-69.2%0.240.360.04971.29$15,120−$78,983
442.0%110.8%-56.2%0.220.340.04421.45$26,370−$76,1553.0%199.8%-64.4%0.280.420.05901.39$22,194−$85,398
472.0%104.4%-57.3%0.210.330.03401.42$26,098−$79,8222.7%164.4%-67.9%0.250.380.04851.31$19,345−$94,115
502.0%110.2%-56.9%0.220.340.04381.43$28,999−$88,1543.1%203.6%-69.1%0.280.420.04781.33$26,108−$118,482
532.0%106.2%-55.8%0.220.330.04371.42$28,707−$90,1453.0%201.9%-67.7%0.280.420.05751.32$26,920−$121,061
561.9%98.9%-56.5%0.210.320.03371.39$26,723−$90,2533.0%197.2%-66.0%0.270.410.05741.33$26,651−$118,134
591.8%90.8%-56.0%0.200.310.03361.36$25,220−$92,5842.8%172.9%-64.9%0.260.390.04721.30$24,014−$114,176
621.8%96.1%-57.7%0.210.320.03351.38$27,445−$96,1642.6%159.3%-68.3%0.250.370.04701.28$22,757−$120,560
651.9%98.7%-57.0%0.210.320.03341.40$29,026−$98,8862.6%155.7%-67.9%0.250.370.04681.28$22,889−$118,744
681.7%83.0%-58.4%0.190.290.03341.35$24,416−$94,9302.1%113.9%-70.0%0.210.320.03681.22$16,750−$109,731
711.2%55.4%-59.0%0.160.240.02341.25$16,304−$87,8491.4%65.3%-71.1%0.170.250.02681.15$9,608−$94,582
741.3%62.2%-57.0%0.170.250.02321.29$19,435−$91,8761.7%86.2%-69.7%0.190.280.02641.18$13,474−$111,868
771.2%54.9%-56.9%0.160.240.02321.26$17,147−$91,1261.6%76.2%-69.4%0.180.260.02641.17$11,909−$104,773
801.4%69.9%-58.7%0.180.270.02301.36$23,296−$93,0101.9%97.0%-72.1%0.200.290.03601.22$16,166−$111,352
852.0%105.4%-54.8%0.220.330.04271.60$39,034−$97,2522.9%185.5%-63.7%0.270.400.05541.42$34,355−$130,610
901.6%81.1%-53.4%0.190.290.03271.51$30,045−$88,5642.2%122.3%-64.2%0.220.330.03541.32$22,649−$113,527
951.6%78.1%-52.6%0.190.290.03261.51$30,056−$90,0742.0%110.2%-63.1%0.210.310.03521.30$21,193−$114,437
1001.1%52.1%-52.7%0.150.230.02251.39$20,825−$82,7501.6%80.3%-64.8%0.180.270.02501.26$16,055−$98,943

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. The swept multiple is labelled ATR Target below, so it is not confused with the Profit Factor column (gross profit ÷ gross loss).

Loading atr target 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. Click an ATR target under the charts to take it off them and let the axis rescale to the rest.

Loading atr target 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. A bar that opens past the stop fills at its open, not at the stop.

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. A bar that opens past the stop fills at its open. 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: Norgate Data continuous futures, Panama (difference) back-adjusted, rolled one business day before last trade or first notice; percentages over the real contract price (daily OHLC), truncated at 2015-12-31 — nothing after that date was read by any calculation on this page. Generated 2026-11-26 23:36:47 UTC.