Data folder: /home/hatch/workspace/maineblock-products/data 

Step 1. The thirty-trade record
Trades: 30. Wins: 15, a win rate of 0.500. Average win +8.18 percent; average loss 7.37 percent; payoff ratio 1.1095 (prints 1.11).
Mean trade return +0.404 percent; standard deviation 11.17 percent; standard error of the mean 2.04 percent.
Profit factor (gross wins over gross losses): 1.110.

Step 2. Breakeven, expectancy, discrete Kelly
Breakeven win rate: 0.474 by the payoff form, 0.474 by the average form (the chapter prints 0.474 both ways).
Expectancy per dollar risked: +0.055. Discrete Kelly stake: 0.0493 (prints 0.049); half 0.025; quarter 0.012.
As a position fraction (the stake over the average loss): 0.669; half 0.335; quarter 0.167.

Step 3. The working rule applied to the record
95 percent interval for the mean trade return: -3.77 to +4.57 percent.
The lower bound is not positive, so the working rule returns a size of zero for this record.
Continuous Kelly on the record's actual spread: 0.323. On the two-point compression of the same record: 0.668.

Step 4. Fragility of the record
Removing the three best trades: the remaining 27 average -1.93 percent a trade.
Charging a quarter point a trade: expectancy +0.15 percent a trade; profit factor 1.040.

Step 5. Bootstrap simulation at the three position fractions
Position fraction 0.669: median maximum drawdown 29.6 percent; drawdown exceeded in only 5 percent of sequences 55.0 percent; median ending equity +0.9 percent.
Position fraction 0.335: median maximum drawdown 15.4 percent; drawdown exceeded in only 5 percent of sequences 31.6 percent; median ending equity +2.3 percent.
Position fraction 0.167: median maximum drawdown 7.9 percent; drawdown exceeded in only 5 percent of sequences 16.9 percent; median ending equity +1.6 percent.

Step 6. The five sizing rules on the strategy series
Months: 120, of which the rule holds SPY in 101. Excess mean 0.7128 percent a month; sample variance 0.001304; continuous Kelly fraction 5.47 (half 2.73, quarter 1.37).
Full Kelly (f = 5.47): CAGR +24.24 percent, maximum drawdown -88.6 percent, worst month -68.78 percent, ending value of one dollar 8.77.
Half Kelly (f = 2.73): CAGR +21.23 percent, maximum drawdown -51.8 percent, worst month -34.33 percent, ending value of one dollar 6.86.
Quarter Kelly (f = 1.37): CAGR +13.02 percent, maximum drawdown -26.2 percent, worst month -17.11 percent, ending value of one dollar 3.40.
Fixed fraction (f = 0.50): CAGR +6.35 percent, maximum drawdown -9.8 percent, worst month -6.18 percent, ending value of one dollar 1.85.
Volatility target (10 percent): CAGR +9.18 percent, maximum drawdown -19.8 percent, worst month -9.92 percent, ending value of one dollar 2.41.
Unsized (f = 1, context): CAGR +10.32 percent, maximum drawdown -19.4 percent, worst month -12.49 percent, ending value of one dollar 2.67.
Volatility rule after the first year: mean multiple 0.95; range 0.45 to the cap of 2.0; at the cap in 6 months.

Step 7. Working rule on the strategy series
Mean excess 0.7128 percent a month; standard error 0.33; 95 percent lower bound 0.060 percent; continuous fraction at the bound 0.46.

Part B. Solution to the R companion lane: the simulation at a win rate five points lower
Degraded win rate across the resampled trades: 0.451 (base 0.500).
Position fraction 0.669: median maximum drawdown 29.6 percent base, 34.2 degraded; median ending equity +0.9 percent base, -14.0 degraded (change -14.9 points).
Position fraction 0.335: median maximum drawdown 15.4 percent base, 18.1 degraded; median ending equity +2.3 percent base, -5.6 degraded (change -7.9 points).
Position fraction 0.167: median maximum drawdown 7.9 percent base, 9.3 degraded; median ending equity +1.6 percent base, -2.4 degraded (change -4.0 points).

Chapter 15 lab complete.
