Strategy Analytics

Corn Moving Average & Profit Factors

SMA-slope optimization on Corn, CAGR / drawdown / Sharpe for the Donchian and MA systems, and an ATR profit-factor sweep.

Instrument
Corn Futures (ZC=F)
History
2000-07-17 → 2026-07-30
SMA Grid
30→70 step 3, then 70→120 step 5 (25 periods)
Profit Factor
1.5 → 10.0 step 0.5 (ATR target × PF)

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, and Sharpe for every base variant (no profit factor) of both systems, on a compounding equity curve over 6,514 daily bars. System A = Long Only, System B = Long & Short (stop-and-reverse). All figures are percentages of capital; CAGR just annualizes the same compounding equity curve, so CAGR and Total Return always move in the same direction.

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: CalmarB: CAGRB: Total ReturnB: Max DDB: SharpeB: SortinoB: Calmar
203.1%120.9%-63.5%0.150.220.050.1%1.3%-76.9%0.000.000.00
233.0%116.8%-63.6%0.150.210.05-0.1%-2.6%-80.6%-0.00-0.01-0.00
263.3%132.0%-69.6%0.160.230.050.5%13.4%-85.8%0.020.030.01
292.5%88.7%-66.9%0.120.170.04-0.8%-18.2%-82.0%-0.03-0.04-0.01
320.5%12.8%-70.8%0.020.030.01-4.5%-69.4%-87.6%-0.17-0.23-0.05
351.2%37.0%-70.1%0.060.080.02-2.9%-52.7%-86.6%-0.11-0.15-0.03
381.2%37.6%-66.1%0.060.080.02-2.7%-51.2%-81.6%-0.10-0.14-0.03
412.6%92.6%-50.1%0.130.180.05-0.7%-15.8%-69.7%-0.02-0.04-0.01
444.2%190.5%-49.9%0.210.310.082.6%94.2%-55.5%0.100.140.05
473.4%137.3%-48.1%0.170.250.071.0%28.4%-58.1%0.040.050.02
503.5%145.1%-49.4%0.180.260.071.2%36.1%-59.5%0.050.070.02
533.4%137.8%-48.2%0.170.250.071.1%32.1%-54.6%0.040.060.02
563.3%132.9%-49.4%0.170.240.070.8%22.9%-63.7%0.030.040.01
592.7%97.5%-53.2%0.140.200.05-0.6%-14.8%-68.6%-0.02-0.03-0.01
622.6%96.3%-58.4%0.130.190.05-0.4%-9.2%-72.8%-0.01-0.02-0.01
652.9%111.8%-58.0%0.150.210.050.4%11.5%-71.4%0.020.020.01
682.9%109.0%-53.5%0.150.210.050.4%11.5%-70.4%0.020.020.01
713.3%133.4%-54.2%0.170.250.061.5%47.4%-67.5%0.060.080.02
742.4%86.2%-58.5%0.120.180.04-0.3%-7.9%-73.8%-0.01-0.02-0.00
772.2%73.6%-58.5%0.110.160.04-0.9%-20.8%-74.1%-0.03-0.05-0.01
801.8%60.1%-60.4%0.090.130.03-1.6%-34.1%-77.1%-0.06-0.09-0.02
851.1%31.2%-62.7%0.050.070.02-3.2%-57.3%-79.0%-0.12-0.17-0.04
901.1%31.6%-66.2%0.050.080.02-3.2%-56.6%-82.6%-0.12-0.17-0.04
95-0.1%-3.5%-68.5%-0.01-0.01-0.00-5.1%-74.0%-84.2%-0.19-0.27-0.06
1000.1%2.2%-69.5%0.000.010.00-5.1%-74.4%-85.1%-0.19-0.27-0.06

Moving Average — SMA Slope

SMA period grid 30→70 step 3, then 70→120 step 5. Exit/reverse when the SMA slope flips. Trades = number of completed trades per system.

SMAA: CAGRA: Total ReturnA: Max DDA: SharpeA: SortinoA: CalmarA: TradesB: CAGRB: Total ReturnB: Max DDB: SharpeB: SortinoB: CalmarB: Trades
303.9%171.7%-69.9%0.190.270.062441.5%46.9%-86.7%0.060.080.02487
332.5%90.9%-64.1%0.120.170.04221-0.8%-17.8%-78.8%-0.03-0.04-0.01441
362.3%81.8%-62.6%0.110.160.04204-1.3%-28.2%-80.7%-0.05-0.07-0.02407
393.5%140.7%-54.3%0.170.240.062161.0%29.7%-73.0%0.040.050.01431
426.2%374.0%-53.0%0.330.480.122065.2%266.7%-67.0%0.200.290.08412
456.9%465.4%-50.0%0.350.510.141897.7%582.5%-56.8%0.290.430.14378
486.8%442.3%-56.2%0.340.490.121827.5%555.9%-66.2%0.290.420.11364
514.5%209.1%-63.6%0.220.320.071973.3%129.2%-77.5%0.120.180.04394
542.3%79.1%-74.1%0.110.160.03185-1.1%-25.2%-90.5%-0.04-0.06-0.01370
573.4%136.3%-70.4%0.170.230.051971.4%42.1%-83.5%0.050.070.02394
602.2%74.7%-75.6%0.110.150.03190-0.8%-19.2%-88.1%-0.03-0.04-0.01380
632.1%69.1%-79.4%0.100.140.03167-0.9%-21.4%-91.5%-0.04-0.05-0.01334
663.1%118.6%-73.7%0.150.210.041600.8%23.9%-86.4%0.030.040.01320
693.3%130.9%-69.2%0.160.220.051751.4%41.4%-79.2%0.050.070.02350
704.8%236.7%-54.7%0.230.330.091784.1%181.4%-55.6%0.160.220.07356
754.4%200.7%-47.6%0.220.320.091513.2%125.8%-56.4%0.120.180.06301
802.2%75.5%-60.4%0.110.160.04154-0.9%-21.1%-77.2%-0.03-0.05-0.01308
851.5%46.0%-61.2%0.070.110.02149-2.2%-43.7%-80.2%-0.08-0.12-0.03298
900.5%14.0%-71.5%0.030.040.01154-4.0%-65.4%-88.5%-0.15-0.22-0.05308
950.5%14.7%-60.8%0.030.040.01140-4.1%-65.9%-74.1%-0.15-0.22-0.06280
1001.1%31.6%-64.8%0.050.070.02134-2.5%-48.3%-77.2%-0.10-0.13-0.03268
1051.6%50.1%-55.4%0.080.110.03138-1.9%-39.2%-65.4%-0.07-0.10-0.03275
1102.1%71.7%-57.4%0.110.150.04128-0.9%-20.5%-69.9%-0.03-0.05-0.01255
115-1.4%-30.9%-69.8%-0.07-0.10-0.02120-7.6%-87.0%-91.5%-0.29-0.41-0.08239
120-1.5%-32.3%-74.2%-0.07-0.11-0.02136-7.6%-86.9%-91.4%-0.29-0.41-0.08271

3. Equity Curve Explorer

Pick any strategy — system, variant, direction, and ATR profit target (or Base) — to see its equity curve: month-end cumulative return on the compounding equity curve, starting at 0%. Use “Compare A vs B” to overlay long-only against long & short.

Equity curves for every strategy (system × variant × direction × profit target) are loaded on demand (~3 MB).

4. Profit Factor Sweep

For every Donchian variant and every MA variant, an ATR profit target is swept from 1.5 to 10.0 (step 0.5) — 900 Donchian strategies and 900 MA strategies. Pick a system, variant, and direction to see how CAGR, Sharpe, and total return respond to the target distance.

Profit factor is the ATR profit-target multiple (target = entry ± PF × ATR₂₀). Each point re-runs the backtest with that target; the position still exits on the opposite signal if the target is not hit first.

CAGR vs Profit Factor

Sharpe vs Profit Factor

Total Return vs Profit Factor

Profit FactorCAGRMax DrawdownSharpeSortinoCalmarTotal ReturnTrades
1.5-7.9%-90.5%-0.30-0.40-0.09-88.1%498
2.0-7.2%-90.7%-0.27-0.36-0.08-85.6%424
2.5-4.1%-80.4%-0.15-0.21-0.05-66.4%367
3.0-5.2%-82.9%-0.19-0.26-0.06-74.7%329
3.5-4.3%-80.4%-0.16-0.22-0.05-67.6%303
4.0-5.6%-87.1%-0.20-0.28-0.06-77.2%282
4.5-5.0%-86.8%-0.18-0.25-0.06-73.5%269
5.0-3.5%-81.2%-0.13-0.18-0.04-59.9%255
5.5-2.8%-82.9%-0.10-0.15-0.03-52.1%245
6.0-1.8%-81.9%-0.07-0.09-0.02-37.7%237
6.5-1.9%-82.7%-0.07-0.10-0.02-39.1%226
7.0-1.9%-78.7%-0.07-0.10-0.02-39.7%220
7.5-2.4%-81.0%-0.09-0.12-0.03-46.5%214
8.0-0.7%-72.8%-0.02-0.03-0.01-15.7%208
8.5-1.7%-77.0%-0.06-0.09-0.02-35.6%203
9.0-1.0%-79.3%-0.04-0.05-0.01-22.8%198
9.5-0.5%-77.1%-0.02-0.03-0.01-12.5%195
10.0-0.3%-75.1%-0.01-0.01-0.00-6.8%193

5. Volatility-Adjusted Profit Target (Dynamic)

SMA system only. The same ATR profit-target sweep as section 4, but the target is recomputed each day from the current ATR (target = entry ± PF × ATR₂₀ today) instead of being frozen at entry. Because it stays measured from the original entry price it only expands or contracts modestly as volatility changes — a more dynamic take-profit that adapts to the market. Pick a variant and direction to compare its CAGR, Sharpe, and total return against the static target above.

SMA system only. Like the profit-factor sweep above, but the ATR target is recomputed each day from the current ATR (target = entry ± PF × ATR₂₀ today) instead of being frozen at entry. It stays anchored to the original entry price, so it expands or contracts modestly as volatility breathes.

CAGR vs Profit Factor

Sharpe vs Profit Factor

Total Return vs Profit Factor

Profit FactorCAGRMax DrawdownSharpeSortinoCalmarTotal ReturnTrades
1.5-5.9%-91.2%-0.21-0.29-0.06-79.1%1008
2.0-4.4%-88.0%-0.16-0.21-0.05-68.4%860
2.5-3.4%-87.3%-0.12-0.17-0.04-59.1%781
3.0-1.3%-86.5%-0.05-0.07-0.02-29.0%725
3.5-1.0%-86.2%-0.04-0.05-0.01-22.7%678
4.0-1.7%-86.9%-0.06-0.09-0.02-35.9%649
4.5-1.3%-87.8%-0.05-0.06-0.01-28.3%627
5.0-1.4%-87.0%-0.05-0.07-0.02-30.5%604
5.5-0.2%-85.7%-0.01-0.01-0.00-4.7%592
6.00.2%-86.0%0.010.010.005.6%573
6.50.5%-85.8%0.020.020.0113.3%565
7.00.4%-86.2%0.010.020.009.9%554
7.51.3%-85.0%0.050.070.0241.4%547
8.00.8%-85.8%0.030.040.0124.1%544
8.50.4%-85.8%0.010.020.0010.0%538
9.0-0.0%-85.8%-0.00-0.00-0.00-0.0%532
9.50.1%-86.5%0.000.000.001.9%527
10.00.2%-86.6%0.010.010.005.6%523

6. Stop Loss Sweep

SMA system only. For every MA variant a protective ATR stop is swept from 1.5 to 10.0 (step 0.5) — 900 MA strategies. Stop = entry ∓ SL × ATR₂₀ (no take-profit); the position still reverses on the opposite SMA-slope signal if the stop is not hit first. Tighter stops cap per-trade losses to try to reduce max drawdown. Pick a variant and direction to see how max drawdown, CAGR, and Sharpe respond to the stop distance.

Stop-loss factor is the ATR stop multiple (stop = entry ∓ SL × ATR₂₀). Each point re-runs the SMA backtest with that protective stop and no take-profit; the position still reverses on the opposite SMA-slope signal if the stop is not hit first. Tighter stops cap per-trade losses to lower max drawdown.

Max Drawdown vs Stop-Loss Factor

CAGR vs Stop-Loss Factor

Sharpe vs Stop-Loss Factor

Stop-Loss FactorCAGRMax DrawdownSharpeSortinoCalmarTotal ReturnTrades
1.56.1%-80.1%0.240.350.08365.3%573
2.04.4%-80.1%0.170.250.05203.3%542
2.53.6%-83.0%0.140.200.04149.7%518
3.02.9%-83.7%0.110.160.03108.6%507
3.52.5%-84.3%0.090.130.0388.2%502
4.02.4%-84.9%0.090.130.0384.8%496
4.52.3%-85.5%0.090.120.0379.1%493
5.02.2%-85.6%0.080.120.0377.4%489
5.52.3%-85.8%0.090.120.0381.1%489
6.02.3%-85.5%0.090.120.0379.5%489
6.52.1%-85.7%0.080.110.0271.8%489
7.02.0%-85.9%0.080.110.0267.8%487
7.51.8%-86.1%0.070.100.0259.5%487
8.01.7%-86.2%0.060.090.0255.3%487
8.51.7%-86.4%0.060.090.0253.6%487
9.01.5%-86.6%0.060.080.0247.9%487
9.51.5%-86.7%0.060.080.0246.9%487
10.01.5%-86.7%0.060.080.0246.9%487

7. ATR Trailing Stop Sweep

SMA system only. A trailing ATR stop, distinct from the fixed stop in section 6: stop = best price reached since entry ∓ f × ATR₂₀, recomputed every day. It ratchets in the trade's favour as the move extends and retreats when volatility rises, giving the trade room. After a stop-out the strategy waits for the next SMA-slope signal to re-enter. The factor is swept 1.0 → 10.0 (step 0.5) — 950 MA strategies. Pick a variant and direction to see how max drawdown, CAGR, and Sharpe respond to the trail distance.

Trailing-stop factor is the ATR multiple subtracted from the best price reached since entry (stop = peak ∓ f × ATR₂₀, recomputed daily). The stop ratchets in the trade's favour as the move extends and retreats when volatility rises. After a stop-out the strategy waits for the next SMA-slope signal to re-enter.

Max Drawdown vs Trailing-Stop Factor

CAGR vs Trailing-Stop Factor

Sharpe vs Trailing-Stop Factor

Trailing-Stop FactorCAGRMax DrawdownSharpeSortinoCalmarTotal ReturnTrades
1.019.2%-53.9%0.921.510.369182.5%1584
1.510.7%-77.7%0.470.710.141268.2%1155
2.06.4%-83.6%0.270.400.08400.0%939
2.57.3%-81.5%0.300.440.09521.4%796
3.06.3%-82.6%0.250.370.08389.5%708
3.56.7%-82.0%0.260.390.08440.0%638
4.03.8%-84.3%0.150.210.05164.0%593
4.52.6%-86.0%0.100.140.0393.9%565
5.03.3%-86.1%0.120.180.04130.0%536
5.52.2%-85.4%0.080.120.0375.4%530
6.02.4%-85.4%0.090.130.0386.5%521
6.52.8%-85.8%0.110.150.03106.6%514
7.02.7%-86.1%0.100.150.03101.5%507
7.52.8%-85.9%0.110.150.03104.4%500
8.02.3%-86.7%0.090.120.0382.0%497
8.52.3%-86.7%0.090.120.0381.5%496
9.02.0%-86.7%0.080.110.0267.4%494
9.51.5%-86.7%0.060.080.0246.9%494
10.01.3%-86.7%0.050.070.0139.4%493

8. Stop Loss + Time Stop — Equity Curves

SMA system only. The full strategy is now: enter on the SMA slope, exit on the opposite signal, ATR stop loss (entry ∓ SL × ATR₂₀), and a time stop — exit a trade still not in profit 5/10/15/20/30/40 days after entry. Pick an SMA period, direction, and ATR SL factor to overlay the equity curve of the ATR stop alone against the 5/10/15/20/30/40-day time-stop upgrades, with CAGR / max drawdown / Sharpe for each.

Equity curves for the SMA stop-loss / time-stop family (every period × direction × ATR SL factor × time stop) are loaded on demand.

9. Time Stop Only — Equity Curves

SMA system only, with no ATR stop — the only risk control is the time stop, so you can judge it on its own as an alternative to the ATR exit. Each line exits a trade still underwater 5/10/15/20/30/40 days after entry; the baseline holds every trade until the SMA slope flips. Pick an SMA period and direction to overlay the equity curve of the plain SMA system against each time-stop-only variant, with CAGR / max drawdown / Sharpe for each.

Equity curves for the SMA time-stop-only family (every period × direction × time stop) are loaded on demand.

10. Volatility Filter Sweep

SMA system only, and the filter is judged on its own — no ATR stop, no target, no time stop. Volatility is the annualized standard deviation of daily returns: the standard deviation of the last 20 daily returns × √252. The volatility factor is swept from 20% to 60% (step 5) as a maximum: a new position is only opened on a day whose volatility sits at or below the factor, so the strategy stands aside in turbulent markets. An open trade is never closed by the filter, which keeps every row directly comparable to the unfiltered system — shown as the dashed “no filter” line on each chart and as the first table row. 450 MA strategies in total.

The volatility factor is the maximum annualized 20-day volatility, in percent: volatility = standard deviation of the last 20 daily returns × √252. A new position is only opened on a day whose volatility is at or below the factor; an open trade is never closed by the filter — it still exits on the opposite SMA-slope signal.

Max Drawdown vs Volatility Factor

CAGR vs Volatility Factor

Sharpe vs Volatility Factor

Volatility FactorDays EligibleCAGRMax DrawdownSharpeSortinoCalmarTotal ReturnTrades
No filter100.0%1.5%-86.7%0.060.080.0246.9%487
20%33.0%-1.4%-77.3%-0.09-0.12-0.02-30.8%246
25%56.2%-2.6%-79.1%-0.13-0.18-0.03-49.1%340
30%73.9%-1.9%-86.0%-0.08-0.12-0.02-39.1%407
35%84.2%-1.3%-83.7%-0.05-0.07-0.02-28.2%441
40%90.6%0.3%-85.4%0.010.020.007.4%458
45%94.2%0.4%-87.2%0.010.020.009.9%477
50%96.4%0.1%-88.9%0.000.000.002.1%485
55%97.5%-0.1%-88.9%-0.00-0.01-0.00-3.1%487
60%98.3%0.6%-87.9%0.020.030.0116.5%487

“Days eligible” is the share of all 6,494 measurable days whose annualized 20-day volatility sits at or below the factor, so you can see how much of the history each cap actually admits. Corn volatility percentiles: p5 13%, p25 18%, p50 23%, p75 30%, p95 46%.

11. Volatility Filter + ATR Trailing Stop

SMA system only. The first combined risk layer on this page: the volatility filter from section 10 and the ATR trailing stop from section 7 running in the same strategy, with both dimensions swept together. A new position is opened only on a day whose annualized 20-day volatility is at or below the volatility factor, and once open the trade exits on the trailing stop (best price reached since entry ∓ f × ATR₂₀, recomputed daily) or on the opposite SMA-slope signal, whichever comes first. That is 19 trailing factors × 9 volatility factors × 25 SMA periods × 2 directions = 8,550 strategies. The dashed line and the last table column are section 7 on its own, so you can read directly whether adding the filter to the trailing stop helps.

Loading the 8,550-row volatility × trailing-stop grid…

12. Volatility Regime Switch

SMA system only, judged on its own — no ATR stop, no target, no time stop. Same volatility measure and same 2060% factors as section 10, but the factor now acts as a regime switch rather than an entry filter: when volatility rises above it the open position is closed at that day's close, no new position is opened while volatility stays above it, and as soon as volatility falls back to the factor or below the position is re-opened on the first day the SMA slope still points the right way — no fresh signal flip required. Each chart draws section 12 against section 10 at the same factor, plus the unfiltered “no filter” baseline, which isolates what closing the trade adds on top of merely standing aside.

Volatility is the same measure as section 10: standard deviation of the last 20 daily returns × √252. Here the factor is a regime switch — above it the open position is closed at that day's close and no new one is opened, and once volatility falls back to the factor or below the position is re-opened on the first day the SMA slope still points the right way.

Max Drawdown vs Volatility Factor

CAGR vs Volatility Factor

Sharpe vs Volatility Factor

Volatility FactorDays EligibleCAGRMax DrawdownSharpeSortinoCalmarTotal ReturnTradesSharpe, §10
No filter100.0%1.5%-86.7%0.060.080.0246.9%4870.060.080.02
20%33.0%-2.3%-63.1%-0.20-0.28-0.04-45.0%317-0.09
25%56.2%-0.8%-57.3%-0.05-0.07-0.01-18.1%407-0.13
30%73.9%-2.7%-82.2%-0.13-0.18-0.03-50.5%457-0.08
35%84.2%-1.8%-81.1%-0.08-0.11-0.02-36.9%482-0.05
40%90.6%-2.2%-88.2%-0.09-0.13-0.03-44.0%4840.01
45%94.2%-1.7%-89.2%-0.07-0.09-0.02-35.2%4970.01
50%96.4%0.2%-89.2%0.010.010.005.9%5030.00
55%97.5%-0.0%-88.7%-0.00-0.00-0.00-0.7%492-0.00
60%98.3%0.9%-87.9%0.030.050.0124.9%4920.02

The last column repeats section 10's Sharpe at the same factor, where the filter only blocks new entries and never closes an open trade. Comparing the two columns answers whether it is worth bailing out of a position when volatility spikes, or only worth standing aside before opening a new one. “Days eligible” is the share of all 6,494 measurable days at or below the factor.

13. Reset / No Reset

The section-7 ATR trailing stop again, with the client's 2026-08-04 question layered on top: what should happen after a stop-out? No Reset treats the stop-out as final — that side stays shut until the SMA slope has flipped away and back, so if prices keep falling the saved profit stays saved. Reset waits for a new high instead: the side re-opens as soon as the market closes back above the highest high the stopped-out trade had reached, even though that is a worse price than the exit, because otherwise a reversal straight after the stop is missed entirely. Immediate is what sections 6, 7 and 11 have always done and is here as the honest third reading: the entry signal is a state rather than an event, so the very next bar re-enters while the slope still points the same way. Both directions are swept, so System A only ever resets long and System B resets whichever side was stopped out. 19 factors × 25 SMA periods × 2 directions × 3 rules = 2,850 strategies.

Loading reset-rule grid…

14. Trade Log — Entry & Exit Dates

The dated trade list behind the sweeps, so a volatility setting can be read as dates rather than as a summary metric: when each position was opened and closed, at what price, what closed it, and how long the system then sat flat before the next entry. Corn only for now, on the client's instruction. Four risk layers are covered — the ATR trailing stop under all three re-entry rules from section 13, the section-10 volatility filter, the section-12 regime switch, and the plain SMA system. The trailing-stop factors here are the whole numbers 1–10 rather than all nineteen half-steps; a trade log is two orders of magnitude bulkier per setting than a sweep row, and section 13 keeps the full resolution for the metrics.

Loading trade log for SMA 66

Source: Yahoo Finance daily OHLC, full available history. Generated 2026-08-04 10:00:59 UTC.