close, reduces variance by 1 divided by root 2 = 71%![]()
Yeah, that's it, thanks Visaria.
close, reduces variance by 1 divided by root 2 = 71%![]()
Yes, although I am not sure if it should be adjusted for volatility (risk), or if it's already adjusted for volatility by incorporating the Kelly. From what I remember, cutting Kelly by 50% reduces the risk by 75%. So, if we are seeking the maximum risk-adjusted return, perhaps we should account for risk.
The point of Kelly is to find the optimal fraction of bankroll to use, variance doesn't come into it unless you can't take the heat. In this situation, we know precisely the probabilities of each outcome and only have a thousand dollars at risk. So no need to scale down Kelly.
package com.et.portfolio;
import java.util.*;
public class Portfolio {
private final static double startEquity = 1000;
private static int maxAllowedDrawdown; // as percent
private final static long numberOfSpins = 10L;
private final static long numberOfTrials = 1000L;
private final static double oneHundred = 100d;
public static void main(String[] args) {
Portfolio portfolio = new Portfolio();
maxAllowedDrawdown = 25;
portfolio.test();
maxAllowedDrawdown = 50;
portfolio.test();
maxAllowedDrawdown = 75;
portfolio.test();
}
class Strategy implements Comparable<Strategy> {
private final int betR16, betR14, betRed;
private double equity, averageProfit, equityPeak;
private long trials;
Strategy(int betR16, int betR14, int betRed) {
this.betR16 = betR16;
this.betR14 = betR14;
this.betRed = betRed;
equity = equityPeak = startEquity;
}
private void update(int outcome) {
if (outcome >= 1 && outcome <= 4) { // R-16
equity += 35 * equity * (betR16 / oneHundred);
}
if (outcome >= 5 && outcome <= 7) { // R-14
equity += 35 * equity * (betR14 / oneHundred);
}
if (outcome >= 1 && outcome <= 23) { // red
equity += 1 * equity * (betRed / oneHundred);
}
if (outcome >= 24 && outcome <= 37) { // anything other than red-16, red-14, or red
equity -= equity * (betR16 + betR14 + betRed) / oneHundred;
}
if (equity > equityPeak) {
equityPeak = equity;
}
double drawdown = 100 * (1 - (equity / equityPeak));
if (drawdown >= maxAllowedDrawdown) {
averageProfit = Double.NEGATIVE_INFINITY; // heavy penalty
}
}
private void update() {
averageProfit += (equity - startEquity);
equity = equityPeak = startEquity;
trials++;
}
public long getAverageProfit() {
return (long) (averageProfit / trials);
}
public double getEquity() {
return equity;
}
@Override
public int compareTo(Strategy other) {
return Long.valueOf(other.getAverageProfit()).compareTo(getAverageProfit());
}
@Override
public String toString() {
String line = "\t" + betR16 + "\t" + betR14 + "\t" + betRed + "\t" + getAverageProfit();
return line;
}
}
private void test() {
int min = 1;
int max = 37;
List<Strategy> strategies = new ArrayList<>();
int maxPercent = 100;
for (int betR16 = 0; betR16 <= maxPercent; betR16++) {
for (int betR14 = 0; betR14 <= maxPercent; betR14++) {
for (int betRed = 0; betRed <= maxPercent; betRed++) {
if (betR16 + betR14 + betRed <= maxPercent) {
Strategy s = new Strategy(betR16, betR14, betRed);
strategies.add(s);
}
}
}
}
System.out.println("total strategies: " + strategies.size());
Random random = new Random();
for (int trial = 1; trial <= numberOfTrials; trial++) {
for (int spin = 1; spin <= numberOfSpins; spin++) {
int outcome = random.nextInt(max + 1 - min) + min;
if (outcome < 1 || outcome > 37) {
throw new RuntimeException("unexpected outcome: " + outcome);
}
for (Strategy s : strategies) {
s.update(outcome);
}
}
for (Strategy s : strategies) {
s.update();
}
}
Collections.sort(strategies); // sort from the best to worst
int count = 0;
String line = "Max allowed drawdown: " + maxAllowedDrawdown;
System.out.println(line);
line = "\t" + "R16" + "\t" + "R14" + "\t" + "Red" + "\t" + "AveProfit";
System.out.println(line);
for (Strategy s : strategies) {
System.out.println(s);
count++;
if (count >= 10) { // only show the top 10 strategies
break;
}
}
}
}
Max allowed drawdown: 25
R16 R14 Red AveProfit
3 0 0 1609
2 1 0 1449
1 2 0 1224
2 0 2 1053
2 0 1 995
0 3 0 953
2 0 0 938
1 1 2 885
1 1 1 833
1 1 0 781
Max allowed drawdown: 50
R16 R14 Red AveProfit
7 0 0 6788
6 1 0 6485
5 2 0 6117
4 3 0 5746
3 4 0 5427
0 7 0 5405
6 0 1 5287
2 5 0 5218
1 6 0 5185
6 0 0 5044
Max allowed drawdown: 75
R16 R14 Red AveProfit
12 2 0 44417
13 1 0 44277
11 3 0 43200
14 0 0 42618
10 4 0 40948
9 5 0 38051
12 1 1 37303
11 2 1 36965
13 0 1 36365
12 1 0 35588
Thanks for demonstrating why I have no use for MCS. There is no optimal strategy that ever risks total loss like the one above does. The first time the ball lands on a black number or the green number, you're done. That's nowhere near optimality.Right, that's what I thought, too, but after running the Monte-Carlo simulation on this problem, the results are totally not what I expected. The top strategy is this combo: {R16:60%, R14:30%, Red:10%}. So, it's a bet of 100% of the bankroll on every bet that maximizes the average profit over many trials. The question is, why so reckless? Well, if you think about it, this strategy has an absolutely enormous variance. Essentially, the result is either an almost certain total loss of $1,000, or a very small chance of a huge gain (in the order of $10 million after the 10 spins of the wheel).
Thanks for demonstrating why I have no use for MCS. There is no optimal strategy that ever risks total loss like the one above does. The first time the ball lands on a black number or the green number, you're done. That's nowhere near optimality.
Kelly is the way to bet even if there's a one-spin limit. Your analysis is wrong.
The Kelly fraction is the optimal geometric growth fraction. It by definition is the betting strategy that will grow your bankroll the fastest for a given trading strategy. If you had only a single spin, which better betting strategy would you use instead of Kelly?When was the last time the law of large number was applicable to small sample-sets, 10 or even 1 as you suggest?
I welcome the proof here that the Kelly fraction is the way to bet on a 1-spin limit. I will certainly learn something and have no shame about it.