I have a problem that involves summing a range of cells that is conditional on past events (or so I think).
I'm working out gaming theory to give as a class assignment and want them to show the maximum profitable gaming model dependent on probability of wins.
The first scenario is easy. Toss a coin and if you win, get a $1, if lose give up $1.
Based on using fair coin the expected outcome is $0 over any proper sampling size.
Now this is the part I am having difficulty with.
Using a different model, let's say that you are using the same coin are looking to win 2 times out of 6 times and will increase the bet by a factor with each loss until you win. Once you win any 2 times out of 6 you'd start the series over again.
So you'd bet $1 on the first toss.
If you lose, bet $2 on the second toss.
If you win, then the series would end, you'd be up by $1 and start over again betting $1 - (Toss 1: -$1; Toss 2: +$2 --> series ends and net is $1). If you were only doing straight bets then the net result would be $0 - (Toss 1: -$1; Toss 2: +$1 --> series ends and net is $0)
Let's say the series for incremental from Bet1 to Bet6 is: $1-$2-$4-$8-$12-$16
I was using a rudimentary setup of randomly showing lines of wins and losses but couldn't figure out how to keep track of every changing series.
One series could be: win-loss-loss-win for a total series count of 4 before starting the betting series over again;
or: loss-win-loss-loss-loss-win for a total series count of 6 before staring the betting series over again;
or any other permutation.
Is there a simple setup and formula so that I could copy and paste over any amount of lines? It's easy to do for a handful of coin tosses, but not over thousands where we can play with different amounts to bet or perhaps create longer series, (e.g. 8 or 10).
I certainly hope this makes sense and someone can help.
p.s. I did do a search in the forum without much luck...
Details:
Windows 7-64bit
Excel 2010
pps. I tried using the MrExcelHtml and hopefully didn't screw it up too badly - thank you for your patience in advance!
I'm working out gaming theory to give as a class assignment and want them to show the maximum profitable gaming model dependent on probability of wins.
The first scenario is easy. Toss a coin and if you win, get a $1, if lose give up $1.
Based on using fair coin the expected outcome is $0 over any proper sampling size.
Now this is the part I am having difficulty with.
Using a different model, let's say that you are using the same coin are looking to win 2 times out of 6 times and will increase the bet by a factor with each loss until you win. Once you win any 2 times out of 6 you'd start the series over again.
So you'd bet $1 on the first toss.
If you lose, bet $2 on the second toss.
If you win, then the series would end, you'd be up by $1 and start over again betting $1 - (Toss 1: -$1; Toss 2: +$2 --> series ends and net is $1). If you were only doing straight bets then the net result would be $0 - (Toss 1: -$1; Toss 2: +$1 --> series ends and net is $0)
Let's say the series for incremental from Bet1 to Bet6 is: $1-$2-$4-$8-$12-$16
I was using a rudimentary setup of randomly showing lines of wins and losses but couldn't figure out how to keep track of every changing series.
One series could be: win-loss-loss-win for a total series count of 4 before starting the betting series over again;
or: loss-win-loss-loss-loss-win for a total series count of 6 before staring the betting series over again;
or any other permutation.
Is there a simple setup and formula so that I could copy and paste over any amount of lines? It's easy to do for a handful of coin tosses, but not over thousands where we can play with different amounts to bet or perhaps create longer series, (e.g. 8 or 10).
I certainly hope this makes sense and someone can help.
p.s. I did do a search in the forum without much luck...
Details:
Windows 7-64bit
Excel 2010
pps. I tried using the MrExcelHtml and hopefully didn't screw it up too badly - thank you for your patience in advance!
Excel 2010 | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | |||
1 | EXPECTED: | ACTUAL: | ||||||||||||
2 | Change Win Ratio Here | Strategy Results after 10,000 trades | Trade | Risk/Reward | ||||||||||
3 | Win % | 50 | No MM | $46 | 1 | $1 | ||||||||
4 | Loss % | 50 | Win % (actual) | 50% | 2 | $2 | ||||||||
5 | (Check) | 100 | Max Drawdown | -$18 | 3 | $4 | ||||||||
6 | 4 | $8 | ||||||||||||
7 | Change Win/Reward $ Here | Number of Wins | 5,021 | Dynamically change how many cells to look back | 5 | $12 | ||||||||
8 | Risk | $1 | Number of Losses | 4,979 | As soon as see a second win, start series over again | 6 | $16 | |||||||
9 | Reward | $1 | Total Trades | 10,000 | ||||||||||
10 | ||||||||||||||
11 | No MM | No MM | ||||||||||||
12 | Coin Toss# | Result | Win/Loss | Win Count | Loss Count | Amount | Accum Profit | Comments (only for guidance) | Trade level | Result: | Amount | Accum Profit | ||
13 | 1 | 90 | loss | 0 | 1 | -$1 | -$1 | Series Start | 1 | loss | -$1 | -$1 | ||
14 | 2 | 2 | win | 1 | 0 | $1 | $2 | 1st win (out of potental 6) | 2 | win | $2 | $1 | ||
15 | 3 | 63 | loss | 0 | 1 | -$1 | $1 | 3 | loss | -$4 | -$3 | |||
16 | 4 | 7 | win | 1 | 0 | $1 | $2 | 2nd win - series ends | 4 | win | $8 | $5 | ||
17 | 5 | 41 | win | 1 | 0 | $1 | $3 | Series Re-start (& 1st win) | 1 | win | $1 | $6 | ||
18 | 6 | 24 | win | 1 | 0 | $1 | $4 | 2nd win - series ends | 2 | win | $2 | $8 | ||
19 | 7 | 19 | win | 1 | 0 | $1 | $5 | Series Re-start (& 1st win) | 1 | win | $1 | $9 | ||
20 | 8 | 54 | loss | 0 | 1 | -$1 | $4 | 2 | loss | -$2 | $7 | |||
21 | 9 | 82 | loss | 0 | 1 | -$1 | $5 | 3 | loss | -$4 | $3 | |||
22 | 10 | 96 | loss | 0 | 1 | -$1 | $4 | 4 | loss | -$8 | -$5 | |||
23 | 11 | 44 | win | 1 | 0 | $1 | $5 | 2nd win - series ends | 5 | win | $12 | $7 | ||
24 | 12 | 59 | loss | 0 | 1 | -$1 | $4 | Series Re-start | 1 | loss | -$1 | $6 | ||
25 | 13 | 52 | loss | 0 | 1 | -$1 | $3 | 2 | loss | -$2 | $4 | |||
26 | 14 | 96 | loss | 0 | 1 | -$1 | $2 | 3 | loss | -$4 | $0 | |||
27 | 15 | 42 | win | 1 | 0 | $1 | $3 | 2nd win - series ends | 4 | win | $8 | $8 | ||
28 | 16 | 34 | win | 1 | 0 | $1 | $4 | Series Re-start | 1 | win | $1 | $9 | ||
29 | 17 | 43 | win | 1 | 0 | $1 | $5 | 2nd win - series ends | 2 | win | $2 | $11 | ||
30 | 18 | 35 | win | 1 | 0 | $1 | $6 | Series Re-start | 1 | win | $1 | $12 | ||
31 | 19 | 73 | loss | 0 | 1 | -$1 | $5 | 2 | loss | -$2 | $10 | |||
32 | 20 | 58 | loss | 0 | 1 | -$1 | $4 | 3 | loss | -$4 | $6 | |||
33 | 21 | 97 | loss | 0 | 1 | -$1 | $3 | 4 | loss | -$8 | -$2 | |||
34 | 22 | 57 | loss | 0 | 1 | -$1 | $2 | 5 | loss | -$12 | -$14 | |||
35 | 23 | 35 | win | 1 | 0 | $1 | $3 | 2nd win - series ends | 6 | win | $16 | $2 | ||
36 | 24 | 78 | loss | 0 | 1 | -$1 | $2 | Series Re-start | 1 | loss | -$1 | $1 | ||
37 | 25 | 56 | loss | 0 | 1 | -$1 | $1 | 2 | loss | -$2 | -$1 | |||
38 | 26 | 78 | loss | 0 | 1 | -$1 | $0 | 3 | loss | -$4 | -$5 | |||
39 | 27 | 63 | loss | 0 | 1 | -$1 | -$1 | 4 | loss | -$8 | -$13 | |||
40 | 28 | 68 | loss | 0 | 1 | -$1 | -$2 | 5 | loss | -$12 | -$25 | |||
41 | 29 | 74 | loss | 0 | 1 | -$1 | -$3 | Series Re-start (6 flips with only 1 win) | 6 | loss | -$16 | -$41 | ||
42 | 30 | 64 | loss | 0 | 1 | -$1 | -$4 | Series Re-start | 1 | loss | -$1 | -$42 | ||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B4 | =100-B3 | |
B5 | =SUM(B3:B4) | |
B13 | =RANDBETWEEN(0,100) | |
E3 | =G10012 | |
E4 | =E7/(E7+E8) | |
E5 | =MIN(G13:G4008) | |
E7 | =SUM(D13:D10012) | |
E8 | =SUM(E13:E10012) | |
E9 | =SUM(E7:E8) | |
E13 | =IF(D13=0,1,0) | |
C13 | =IF(B13<=$B$3,"win","loss") | |
D13 | =IF(C13="win",1,0) | |
F13 | =IF(C13="loss",$B$8*-1,$B$9) | |
G13 | =SUM($F$13:F13) | |
K13 | =IF(J13="loss",VLOOKUP(I13,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I13,$K$3:$L$8,2,FALSE)) | |
K14 | =IF(J14="loss",VLOOKUP(I14,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I14,$K$3:$L$8,2,FALSE)) | |
K15 | =IF(J15="loss",VLOOKUP(I15,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I15,$K$3:$L$8,2,FALSE)) | |
K16 | =IF(J16="loss",VLOOKUP(I16,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I16,$K$3:$L$8,2,FALSE)) | |
K17 | =IF(J17="loss",VLOOKUP(I17,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I17,$K$3:$L$8,2,FALSE)) | |
K18 | =IF(J18="loss",VLOOKUP(I18,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I18,$K$3:$L$8,2,FALSE)) | |
K19 | =IF(J19="loss",VLOOKUP(I19,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I19,$K$3:$L$8,2,FALSE)) | |
K20 | =IF(J20="loss",VLOOKUP(I20,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I20,$K$3:$L$8,2,FALSE)) | |
K21 | =IF(J21="loss",VLOOKUP(I21,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I21,$K$3:$L$8,2,FALSE)) | |
K22 | =IF(J22="loss",VLOOKUP(I22,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I22,$K$3:$L$8,2,FALSE)) | |
K23 | =IF(J23="loss",VLOOKUP(I23,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I23,$K$3:$L$8,2,FALSE)) | |
K24 | =IF(J24="loss",VLOOKUP(I24,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I24,$K$3:$L$8,2,FALSE)) | |
K25 | =IF(J25="loss",VLOOKUP(I25,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I25,$K$3:$L$8,2,FALSE)) | |
K26 | =IF(J26="loss",VLOOKUP(I26,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I26,$K$3:$L$8,2,FALSE)) | |
K27 | =IF(J27="loss",VLOOKUP(I27,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I27,$K$3:$L$8,2,FALSE)) | |
K28 | =IF(J28="loss",VLOOKUP(I28,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I28,$K$3:$L$8,2,FALSE)) | |
K29 | =IF(J29="loss",VLOOKUP(I29,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I29,$K$3:$L$8,2,FALSE)) | |
K30 | =IF(J30="loss",VLOOKUP(I30,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I30,$K$3:$L$8,2,FALSE)) | |
K31 | =IF(J31="loss",VLOOKUP(I31,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I31,$K$3:$L$8,2,FALSE)) | |
K32 | =IF(J32="loss",VLOOKUP(I32,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I32,$K$3:$L$8,2,FALSE)) | |
K33 | =IF(J33="loss",VLOOKUP(I33,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I33,$K$3:$L$8,2,FALSE)) | |
K34 | =IF(J34="loss",VLOOKUP(I34,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I34,$K$3:$L$8,2,FALSE)) | |
K35 | =IF(J35="loss",VLOOKUP(I35,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I35,$K$3:$L$8,2,FALSE)) | |
K36 | =IF(J36="loss",VLOOKUP(I36,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I36,$K$3:$L$8,2,FALSE)) | |
K37 | =IF(J37="loss",VLOOKUP(I37,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I37,$K$3:$L$8,2,FALSE)) | |
K38 | =IF(J38="loss",VLOOKUP(I38,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I38,$K$3:$L$8,2,FALSE)) | |
K39 | =IF(J39="loss",VLOOKUP(I39,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I39,$K$3:$L$8,2,FALSE)) | |
K40 | =IF(J40="loss",VLOOKUP(I40,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I40,$K$3:$L$8,2,FALSE)) | |
K41 | =IF(J41="loss",VLOOKUP(I41,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I41,$K$3:$L$8,2,FALSE)) | |
K42 | =IF(J42="loss",VLOOKUP(I42,$K$3:$L$8,2,FALSE)*-1,VLOOKUP(I42,$K$3:$L$8,2,FALSE)) | |
L13 | =SUM($K$13:K13) | |
L14 | =SUM($K$13:K14) | |
L15 | =SUM($K$13:K15) | |
L16 | =SUM($K$13:K16) | |
L17 | =SUM($K$13:K17) | |
L18 | =SUM($K$13:K18) | |
L19 | =SUM($K$13:K19) | |
L20 | =SUM($K$13:K20) | |
L21 | =SUM($K$13:K21) | |
L22 | =SUM($K$13:K22) | |
L23 | =SUM($K$13:K23) | |
L24 | =SUM($K$13:K24) | |
L25 | =SUM($K$13:K25) | |
L26 | =SUM($K$13:K26) | |
L27 | =SUM($K$13:K27) | |
L28 | =SUM($K$13:K28) | |
L29 | =SUM($K$13:K29) | |
L30 | =SUM($K$13:K30) | |
L31 | =SUM($K$13:K31) | |
L32 | =SUM($K$13:K32) | |
L33 | =SUM($K$13:K33) | |
L34 | =SUM($K$13:K34) | |
L35 | =SUM($K$13:K35) | |
L36 | =SUM($K$13:K36) | |
L37 | =SUM($K$13:K37) | |
L38 | =SUM($K$13:K38) | |
L39 | =SUM($K$13:K39) | |
L40 | =SUM($K$13:K40) | |
L41 | =SUM($K$13:K41) | |
L42 | =SUM($K$13:K42) |