Strategy Analytics

Coffee — Moving Average & Risk Layers

The same sections as the Corn MA page, on Coffee (KC=F). Volatility ranges are calibrated to this market rather than copied from Corn.

Instrument
Coffee (KC=F)
History
1978-12-14 → 2026-09-22
Trading Days / Year
252
Volatility Grid
20–60% (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. Half is charged on entry and half on exit (a position still open at the end has paid only its entry half); on the compounding curve the cost is a share of the contract's real value at entry, so it weighs more on short, frequent trades. Profit Factor is gross profit ÷ gross loss over all trades (not the ATR target multiple sections 4–5 call “profit factor”); Avg Trade and Avg Loss are net USD per contract. Contract rolls are not charged as extra round turns.
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 14.7%, p10 17.6%, p25 23.8%, p50 29.7%, p75 37.6%, p90 47.5%, p95 56.0%. Metrics annualize with 252 trading days per year. A cell at −100% CAGR means a position lost more than its stake — typically a short in a contract that more than doubled before the exit — and the later numbers in that cell are not meaningful. 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 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, trade count, profit factor and the average trade / average losing trade for every base variant of both systems over 11,982 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
20-2.6%-70.9%-97.9%-0.10-0.15-0.031500.94−$177−$3,915-4.8%-90.1%-99.4%-0.15-0.21-0.053000.96−$107−$4,099
23-1.6%-54.1%-96.9%-0.06-0.09-0.021271.13$340−$3,793-2.7%-73.1%-98.7%-0.08-0.12-0.032541.17$423−$3,963
26-1.2%-44.7%-96.9%-0.05-0.07-0.011141.12$356−$4,210-2.1%-64.2%-98.8%-0.07-0.10-0.022281.16$449−$4,276
29-1.0%-39.1%-97.5%-0.04-0.06-0.011001.13$432−$4,620-1.1%-40.2%-99.1%-0.03-0.05-0.012001.19$542−$4,500
32-0.8%-31.9%-96.7%-0.03-0.05-0.01911.14$482−$5,082-0.7%-27.3%-98.6%-0.02-0.03-0.011821.20$611−$4,878
35-0.5%-22.5%-97.1%-0.02-0.03-0.01831.19$700−$5,2530.2%10.2%-98.5%0.010.010.001661.28$841−$4,955
38-1.3%-46.2%-97.1%-0.05-0.07-0.01761.16$648−$5,678-1.3%-47.0%-98.9%-0.04-0.06-0.011521.24$802−$5,256
41-0.7%-27.1%-96.2%-0.03-0.04-0.01681.27$1,083−$5,451-0.4%-15.6%-98.3%-0.01-0.02-0.001351.39$1,265−$5,066
440.5%25.2%-94.7%0.020.030.00621.37$1,517−$5,7162.1%166.5%-96.9%0.060.090.021231.53$1,720−$5,106
47-0.1%-2.7%-95.6%-0.00-0.00-0.00591.34$1,443−$5,8330.7%38.9%-98.0%0.020.030.011171.49$1,655−$5,366
500.2%10.1%-95.3%0.010.010.00541.34$1,450−$5,9590.7%40.8%-97.9%0.020.030.011071.46$1,683−$5,819
530.1%2.5%-95.7%0.000.000.00521.27$1,247−$6,3970.0%0.2%-98.3%0.000.000.001031.37$1,487−$6,111
560.4%20.8%-93.8%0.020.020.00501.30$1,396−$6,0501.0%63.3%-96.2%0.030.050.01991.42$1,652−$5,805
59-0.2%-10.3%-93.9%-0.01-0.01-0.00491.22$1,069−$6,547-0.2%-10.2%-96.9%-0.01-0.01-0.00971.32$1,354−$6,233
62-0.3%-12.0%-94.5%-0.01-0.02-0.00471.20$1,035−$6,879-0.4%-18.6%-97.6%-0.01-0.02-0.00931.30$1,331−$6,614
65-0.0%-1.2%-94.4%-0.00-0.00-0.00451.28$1,375−$6,7510.4%22.8%-96.0%0.010.020.00891.41$1,689−$6,141
68-0.6%-25.5%-95.1%-0.02-0.04-0.01451.21$1,084−$6,983-0.7%-29.2%-97.0%-0.02-0.03-0.01891.33$1,394−$6,343
71-1.3%-47.2%-95.5%-0.05-0.08-0.01451.14$754−$7,305-2.1%-63.7%-97.5%-0.07-0.09-0.02891.24$1,074−$6,558
74-0.9%-34.2%-94.8%-0.03-0.05-0.01421.15$865−$7,784-1.2%-42.6%-96.2%-0.04-0.05-0.01831.26$1,226−$7,082
77-1.0%-38.0%-94.9%-0.04-0.06-0.01411.13$776−$7,962-1.6%-54.6%-96.8%-0.05-0.07-0.02811.23$1,145−$7,218
800.0%1.8%-92.9%0.000.000.00381.36$1,858−$7,355-0.2%-8.7%-96.6%-0.01-0.01-0.00751.48$2,281−$6,994
851.0%63.2%-91.4%0.040.060.01351.57$2,715−$6,9441.7%120.7%-93.5%0.050.080.02691.70$3,187−$6,996
900.4%19.4%-92.0%0.020.020.00351.43$2,184−$7,4610.4%21.2%-94.6%0.010.020.00691.55$2,659−$7,305
950.2%9.1%-91.1%0.010.010.00341.37$2,024−$7,993-0.0%-1.9%-93.5%-0.00-0.00-0.00671.49$2,538−$7,871
100-0.1%-5.3%-91.5%-0.00-0.01-0.00331.37$1,933−$7,895-0.3%-11.6%-94.5%-0.01-0.01-0.00651.49$2,469−$7,590

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
30-2.1%-63.7%-94.7%-0.08-0.12-0.024691.03$31−$1,544-3.1%-78.1%-95.7%-0.10-0.14-0.039391.05$51−$1,539
33-1.9%-60.0%-97.4%-0.07-0.11-0.024561.05$59−$1,541-3.0%-76.0%-99.1%-0.09-0.13-0.039121.08$81−$1,501
36-1.5%-52.3%-98.0%-0.06-0.09-0.024261.07$91−$1,736-2.4%-68.6%-99.4%-0.07-0.11-0.028521.10$114−$1,620
390.3%15.2%-95.2%0.010.020.004071.17$196−$1,6031.2%76.9%-96.9%0.040.050.018141.21$221−$1,534
42-0.4%-18.6%-96.4%-0.02-0.03-0.003831.15$181−$1,655-0.2%-10.0%-98.4%-0.01-0.01-0.007661.19$207−$1,600
45-1.3%-45.8%-96.3%-0.05-0.07-0.013821.11$126−$1,737-1.7%-56.5%-98.1%-0.05-0.08-0.027641.14$153−$1,651
480.9%50.3%-94.7%0.030.050.013441.25$288−$1,7302.3%191.1%-95.6%0.070.100.026881.29$320−$1,613
511.5%99.2%-88.0%0.060.090.023281.27$323−$1,7603.4%387.3%-87.8%0.110.150.046561.33$356−$1,652
541.9%147.1%-92.3%0.080.110.023061.39$476−$1,7544.3%648.0%-93.7%0.130.190.056121.47$514−$1,708
571.7%119.4%-86.4%0.070.100.023041.42$491−$1,6614.3%628.2%-86.3%0.130.200.056081.51$533−$1,604
60-0.2%-10.2%-95.9%-0.01-0.01-0.003261.22$273−$1,7590.0%1.0%-98.0%0.000.000.006511.28$313−$1,669
630.4%21.8%-95.3%0.020.020.003441.23$258−$1,5361.7%121.1%-96.7%0.050.080.026871.29$295−$1,506
661.5%100.5%-92.1%0.060.090.023061.30$344−$1,5903.6%433.5%-92.8%0.110.160.046111.37$384−$1,542
690.3%17.5%-93.4%0.010.020.003101.18$226−$1,7131.2%75.3%-94.5%0.040.060.016191.24$270−$1,610
700.1%2.5%-94.7%0.000.000.003041.29$322−$1,5670.6%30.9%-96.6%0.020.030.016071.35$367−$1,506
75-0.5%-21.7%-95.4%-0.02-0.03-0.012951.20$235−$1,611-1.0%-38.5%-98.0%-0.03-0.05-0.015891.25$282−$1,533
802.6%233.8%-92.1%0.100.160.032561.51$583−$1,5934.8%809.5%-95.8%0.150.220.055111.59$641−$1,599
851.2%75.5%-91.7%0.050.070.012601.38$452−$1,6472.3%196.9%-96.6%0.070.110.025191.46$508−$1,522
902.2%187.1%-85.8%0.090.140.032341.47$574−$1,8254.8%817.4%-84.8%0.150.220.064671.58$639−$1,632
953.0%306.2%-81.2%0.120.180.042291.55$623−$1,6986.3%1685.8%-81.6%0.200.300.084571.64$692−$1,631
1001.9%147.5%-89.9%0.080.120.022281.54$586−$1,6134.2%605.3%-90.8%0.140.200.054551.64$658−$1,579
1050.9%56.1%-89.5%0.040.060.011971.29$388−$1,9921.3%81.0%-93.4%0.040.060.013931.35$468−$1,979
1100.7%40.3%-91.0%0.030.040.012071.19$262−$2,0561.1%68.9%-95.4%0.040.050.014131.24$335−$2,015
115-0.5%-22.4%-90.6%-0.02-0.03-0.012001.11$150−$1,922-1.7%-55.3%-95.7%-0.05-0.08-0.023991.16$230−$2,116
120-2.0%-62.6%-94.5%-0.09-0.12-0.022040.98−$28−$2,073-5.3%-92.6%-98.5%-0.17-0.24-0.054071.05$73−$2,147

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
20-1.9%-60.2%-96.6%-0.08-0.12-0.021130.98−$61−$4,472-1.9%-59.5%-98.9%-0.06-0.09-0.022371.10$254−$3,937
23-1.1%-41.2%-96.0%-0.05-0.07-0.01981.15$464−$4,523-1.5%-51.2%-98.5%-0.05-0.07-0.022091.22$568−$4,146
26-1.4%-47.6%-96.3%-0.06-0.08-0.01921.12$395−$4,582-1.8%-58.2%-98.8%-0.06-0.09-0.021941.18$519−$4,303
29-0.8%-30.3%-96.0%-0.03-0.05-0.01821.18$650−$4,816-0.7%-30.1%-98.5%-0.02-0.04-0.011741.23$657−$4,490
32-0.5%-21.1%-95.3%-0.02-0.03-0.01761.19$732−$5,2630.2%11.9%-97.9%0.010.010.001581.28$858−$4,822
35-0.7%-26.7%-96.4%-0.03-0.04-0.01721.20$785−$5,2830.5%28.7%-98.4%0.020.030.011491.30$945−$4,843
38-1.0%-36.9%-96.7%-0.04-0.06-0.01661.19$829−$6,128-0.9%-34.0%-98.7%-0.03-0.04-0.011391.24$840−$5,385
41-0.1%-6.2%-95.6%-0.01-0.01-0.00601.33$1,398−$5,606-0.3%-15.1%-98.3%-0.01-0.02-0.001261.36$1,226−$5,179
440.8%42.7%-93.3%0.030.040.01561.41$1,733−$5,7991.6%117.3%-96.1%0.050.080.021171.48$1,630−$5,273
470.2%9.6%-94.9%0.010.010.00541.36$1,590−$5,8510.2%11.2%-98.0%0.010.010.001121.42$1,508−$5,485
50-0.2%-7.9%-95.2%-0.01-0.01-0.00521.29$1,323−$6,044-0.1%-4.8%-98.1%-0.00-0.00-0.001051.38$1,476−$5,935
53-0.6%-24.0%-95.6%-0.02-0.03-0.01511.21$1,031−$6,563-1.1%-40.6%-98.5%-0.04-0.05-0.011021.29$1,228−$6,266
56-0.4%-15.6%-94.4%-0.01-0.02-0.00501.23$1,101−$6,384-0.1%-6.8%-96.9%-0.00-0.01-0.00991.33$1,377−$6,061
59-0.7%-27.4%-94.1%-0.03-0.04-0.01491.18$891−$6,728-1.1%-40.5%-97.3%-0.03-0.05-0.01971.26$1,136−$6,396
62-0.7%-28.8%-94.7%-0.03-0.04-0.01471.16$849−$7,070-1.3%-46.5%-98.0%-0.04-0.06-0.01931.24$1,106−$6,778
65-0.4%-16.0%-94.5%-0.01-0.02-0.00451.24$1,241−$6,934-0.3%-15.1%-96.4%-0.01-0.02-0.00891.34$1,479−$6,313
68-0.8%-33.1%-95.2%-0.03-0.05-0.01451.19$979−$7,125-1.3%-47.2%-97.5%-0.04-0.06-0.01891.27$1,210−$6,475
71-1.5%-51.3%-95.5%-0.06-0.09-0.02451.12$676−$7,412-2.6%-72.0%-97.8%-0.08-0.12-0.03891.20$910−$6,773
74-1.0%-37.9%-94.8%-0.04-0.06-0.01421.14$817−$7,848-1.7%-54.7%-96.5%-0.05-0.07-0.02831.22$1,068−$7,289
77-1.1%-41.6%-94.9%-0.04-0.07-0.01411.12$728−$8,028-2.0%-61.2%-96.8%-0.06-0.09-0.02811.20$1,034−$7,352
80-0.1%-4.0%-92.9%-0.00-0.01-0.00381.34$1,806−$7,428-0.5%-20.2%-96.6%-0.02-0.02-0.00751.45$2,160−$7,089
850.9%53.9%-91.4%0.040.050.01351.55$2,658−$7,0271.5%103.6%-93.5%0.050.070.02691.68$3,120−$7,040
900.2%12.6%-92.0%0.010.010.00351.41$2,127−$7,5430.3%14.3%-94.6%0.010.010.00691.54$2,630−$7,349
950.2%9.1%-91.1%0.010.010.00341.37$2,024−$7,993-0.0%-1.9%-93.5%-0.00-0.00-0.00671.49$2,538−$7,871
100-0.1%-5.3%-91.5%-0.00-0.01-0.00331.37$1,933−$7,895-0.3%-11.6%-94.5%-0.01-0.01-0.00651.49$2,469−$7,590

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.

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…

7b. ATR Trailing Stop — Equity Curve

Section 7 as an equity curve: pick an SMA period, direction and trailing factor to see the strategy's month-end cumulative return, net of costs, against the plain SMA system with no stop. Every factor of the section-7 sweep is here, so any row of its table can be looked at as a curve.

Loading equity curves…

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…

11b. Volatility Filter + ATR Trailing Stop — Equity Curve

Section 11 as an equity curve: pick an SMA period, direction, trailing factor and volatility cap to see the combined strategy's month-end cumulative return, net of costs, against the trailing stop alone (section 7, same factor) and the plain SMA system. Trailing factors 1, 2, 3, 4, 5, 6, 7, 8, 9, 10; the section-11 matrix above keeps every half-step.

Loading equity curves…

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…

13. Reset / No Reset

Section 7's trailing stop with the client's 2026-08-04 question on top: after a stop-out, does re-entering beat staying out? No Reset shuts that side until the SMA slope has flipped away and back, so a market that keeps falling leaves the saved profit saved. Reset waits for a new high — the side re-opens when the market closes back above the stopped-out trade's highest high, at a worse price than the exit, so that a reversal is not missed. Immediate is what section 7 itself does, since its entry signal is a state and not an event: the next bar re-enters while the slope still points the same way. Both directions are swept, so System A only resets long and System B resets whichever side was stopped out.

Loading reset-rule 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), full available history. Generated 2026-10-06 13:16:09 UTC.