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
2000-01-03 → 2026-07-30
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 22.1%, p25 26.4%, p50 31.8%, p75 37.6%, p90 44.1%, p95 49.9%. 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 6,662 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-4.5%-70.6%-82.6%-0.17-0.25-0.0593-15.3%-98.8%-99.1%-0.46-0.65-0.15186
23-5.1%-75.1%-81.4%-0.20-0.29-0.0685-16.3%-99.1%-99.4%-0.49-0.68-0.16170
26-3.8%-64.0%-78.4%-0.15-0.22-0.0573-13.9%-98.1%-98.8%-0.42-0.59-0.14146
29-6.0%-80.5%-89.3%-0.24-0.34-0.0769-18.2%-99.5%-99.7%-0.54-0.75-0.18138
32-4.0%-66.0%-83.1%-0.16-0.23-0.0559-14.3%-98.3%-98.8%-0.43-0.60-0.15118
35-3.5%-61.5%-79.9%-0.14-0.20-0.0453-13.3%-97.7%-98.5%-0.40-0.56-0.13106
38-2.8%-52.7%-78.7%-0.11-0.16-0.0447-12.0%-96.6%-98.5%-0.36-0.51-0.1294
41-0.4%-11.1%-72.0%-0.02-0.03-0.0141-7.4%-86.9%-96.5%-0.22-0.32-0.0882
440.7%20.6%-64.3%0.030.040.0137-5.7%-78.8%-93.8%-0.17-0.25-0.0674
47-0.7%-16.5%-66.2%-0.03-0.04-0.0136-8.5%-90.4%-96.0%-0.26-0.36-0.0972
50-1.5%-32.6%-70.5%-0.06-0.08-0.0235-10.9%-95.2%-97.4%-0.33-0.46-0.1170
53-1.8%-37.7%-70.5%-0.07-0.10-0.0334-11.5%-96.1%-97.7%-0.35-0.49-0.1268
56-1.4%-30.5%-70.5%-0.05-0.08-0.0233-10.6%-94.8%-96.9%-0.33-0.45-0.1166
590.1%1.7%-64.6%0.000.000.0030-7.9%-88.8%-93.1%-0.24-0.34-0.0960
620.1%3.5%-65.2%0.010.010.0029-7.8%-88.3%-92.8%-0.24-0.34-0.0858
651.1%32.2%-60.3%0.040.060.0227-5.9%-79.7%-88.5%-0.18-0.25-0.0754
680.7%21.3%-61.5%0.030.040.0127-6.6%-83.4%-90.6%-0.20-0.28-0.0754
710.9%28.2%-63.3%0.040.050.0126-6.5%-83.1%-90.1%-0.20-0.28-0.0752
742.0%70.4%-63.4%0.080.120.0324-4.3%-68.8%-82.3%-0.13-0.19-0.0548
772.2%77.3%-59.0%0.090.130.0422-4.4%-69.3%-82.5%-0.13-0.19-0.0544
801.7%56.1%-59.0%0.070.100.0322-5.5%-77.7%-86.5%-0.17-0.24-0.0644
851.7%54.5%-62.5%0.070.100.0321-6.0%-80.3%-86.0%-0.18-0.25-0.0742
901.3%38.9%-62.5%0.050.070.0221-6.7%-84.1%-87.4%-0.20-0.29-0.0842
951.7%55.2%-52.1%0.070.100.0320-6.3%-82.3%-89.0%-0.19-0.27-0.0740
1002.5%90.5%-51.2%0.100.140.0518-4.3%-68.8%-89.9%-0.13-0.19-0.0536

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-0.9%-21.1%-68.6%-0.03-0.05-0.01266-8.2%-89.6%-93.9%-0.25-0.35-0.09532
33-5.3%-76.4%-86.9%-0.21-0.30-0.06290-16.4%-99.1%-99.3%-0.49-0.68-0.16580
36-2.1%-42.9%-80.4%-0.08-0.12-0.03253-10.9%-95.2%-98.3%-0.33-0.46-0.11506
39-1.1%-26.1%-71.7%-0.04-0.07-0.02233-8.9%-91.6%-96.9%-0.27-0.39-0.09466
42-2.0%-41.9%-79.4%-0.08-0.12-0.03268-10.5%-94.7%-98.0%-0.32-0.45-0.11536
45-3.3%-58.7%-80.6%-0.13-0.19-0.04247-12.8%-97.3%-98.5%-0.39-0.55-0.13494
48-0.3%-8.6%-60.7%-0.01-0.02-0.01229-7.1%-85.6%-90.5%-0.22-0.30-0.08458
51-0.6%-15.4%-65.1%-0.02-0.04-0.01213-8.2%-89.5%-92.7%-0.25-0.35-0.09426
540.8%24.8%-65.4%0.030.050.01226-4.7%-72.0%-81.6%-0.14-0.21-0.06452
573.7%163.9%-63.6%0.150.220.062020.3%9.2%-80.3%0.010.010.00404
604.5%220.6%-61.2%0.180.260.071962.3%81.8%-77.4%0.070.100.03392
632.7%103.7%-66.6%0.110.160.04218-1.7%-36.0%-87.4%-0.05-0.07-0.02436
660.9%25.2%-68.6%0.030.050.01216-5.2%-75.4%-95.3%-0.16-0.23-0.05432
69-0.3%-8.4%-67.9%-0.01-0.02-0.00194-7.7%-87.9%-94.1%-0.24-0.33-0.08388
701.0%31.3%-67.8%0.040.060.02198-5.3%-76.0%-89.7%-0.16-0.23-0.06396
75-0.7%-17.4%-76.7%-0.03-0.04-0.01170-8.4%-90.1%-95.9%-0.26-0.37-0.09340
803.1%122.9%-69.6%0.120.180.04183-1.7%-35.6%-85.5%-0.05-0.07-0.02366
854.3%205.5%-57.4%0.170.250.081531.1%35.1%-70.1%0.040.050.02306
903.2%127.2%-64.3%0.120.180.05154-1.1%-25.3%-81.8%-0.03-0.05-0.01308
953.4%140.1%-68.9%0.130.200.05149-1.4%-30.5%-83.4%-0.04-0.06-0.02298
1002.6%98.9%-74.5%0.100.150.04146-2.2%-43.8%-89.0%-0.07-0.10-0.02292
1052.5%89.8%-64.2%0.100.140.04131-2.6%-50.2%-76.9%-0.08-0.12-0.03262
1100.6%15.7%-68.3%0.020.030.01156-6.7%-84.0%-86.0%-0.21-0.29-0.08312
1150.6%18.1%-63.3%0.030.040.01140-7.4%-86.8%-89.4%-0.23-0.33-0.08280
1201.9%63.5%-62.8%0.080.110.03134-5.4%-76.9%-87.1%-0.17-0.24-0.06268

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-1.9%-39.1%-70.4%-0.08-0.11-0.0371-9.2%-92.3%-95.5%-0.31-0.43-0.10146
23-1.4%-31.7%-67.5%-0.06-0.09-0.0264-8.6%-90.7%-94.4%-0.28-0.40-0.09132
260.2%4.2%-60.9%0.010.010.0057-8.2%-89.6%-94.9%-0.26-0.37-0.09118
29-1.7%-37.2%-66.7%-0.07-0.11-0.0355-12.1%-96.7%-98.5%-0.38-0.53-0.12113
32-0.5%-11.5%-63.2%-0.02-0.03-0.0148-11.1%-95.5%-97.8%-0.34-0.48-0.11102
35-1.4%-31.0%-67.9%-0.06-0.08-0.0246-11.0%-95.4%-97.9%-0.34-0.48-0.1195
380.2%5.8%-58.2%0.010.010.0040-9.8%-93.4%-97.3%-0.30-0.42-0.1085
412.6%95.4%-54.3%0.100.150.0535-5.8%-79.5%-93.4%-0.18-0.25-0.0676
442.0%69.3%-56.9%0.080.120.0434-5.7%-79.1%-92.6%-0.18-0.25-0.0671
470.1%3.5%-59.9%0.010.010.0034-8.5%-90.5%-95.7%-0.26-0.37-0.0970
50-0.6%-14.7%-63.7%-0.02-0.03-0.0133-10.6%-94.8%-97.2%-0.33-0.46-0.1168
53-1.2%-27.0%-64.4%-0.05-0.07-0.0233-11.5%-96.0%-97.6%-0.35-0.49-0.1267
56-0.7%-17.6%-66.7%-0.03-0.04-0.0132-10.4%-94.6%-96.7%-0.32-0.45-0.1165
59-0.1%-2.9%-64.9%-0.00-0.01-0.0030-8.6%-90.6%-94.2%-0.26-0.37-0.0960
620.1%2.6%-65.5%0.000.010.0029-8.3%-89.8%-93.7%-0.25-0.36-0.0958
651.0%31.1%-60.6%0.040.060.0227-6.4%-82.4%-89.6%-0.20-0.28-0.0754
680.7%20.3%-61.5%0.030.040.0127-7.1%-85.5%-91.5%-0.22-0.31-0.0854
710.9%27.0%-63.3%0.040.050.0126-7.0%-85.3%-91.0%-0.21-0.30-0.0852
742.0%68.9%-63.4%0.080.110.0324-4.8%-72.9%-83.9%-0.15-0.21-0.0648
772.2%75.8%-59.0%0.080.120.0422-4.7%-71.8%-83.2%-0.14-0.20-0.0644
801.7%56.1%-59.0%0.070.100.0322-5.8%-79.4%-87.0%-0.18-0.25-0.0744
851.7%54.5%-62.5%0.070.100.0321-6.0%-80.4%-86.0%-0.18-0.26-0.0742
901.3%38.9%-62.5%0.050.070.0221-6.7%-84.1%-87.4%-0.20-0.29-0.0842
951.7%55.2%-52.1%0.070.100.0320-6.3%-82.3%-89.0%-0.19-0.27-0.0740
1002.5%90.5%-51.2%0.100.140.0518-4.3%-68.8%-89.9%-0.13-0.19-0.0536

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…

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: Yahoo Finance daily OHLC, full available history. Generated 2026-07-30 08:44:13 UTC.