principlecsharpMinor
Betting strategy simulation
Viewed 0 times
bettingsimulationstrategy
Problem
I lately got interested into betting systems, dice strategies and algorithms. I took some time to think about it and eventually ended up with an algorithm of my own.
Considering that I don't have unlimited money that would allow me to test it on a real dice betting site (duh), I have coded a simulation that allows me to run my algorithm in an environment that reproduces those websites.
Although I have not tested it in extreme conditions (really large number of rolls) it seems to work pretty well, and I never got my simulation going "out of bankroll" or even finish the algorithm with less bankroll than it started with.
I have commented this so it is clear to everyone what I was thinking and why is every operation doing.
```
public static void Main(string[] args)
{
simulation1(0.000001, 1.1, 1.09, 10.9, 0.01, 10);
}/* | | | | | L--> This is the number of "Big Wins" you want to play. The simulation will
| | | | | play until that number is reached.
| | | | L-------> This is your initial Balance. The simulation will stop and warn you if
| | | | any bet gets too big for your actualBalance, but you gotta start
| | | | with something.
| | | L-------------> This is The multiplicator after loss. Basically, when you lose, the
| | | next bet(s) will be multiplicated by this amount until you win again,
| | | which will be a "Big Win" and is gonna reset your iterations.
| | L------------------> This is the multiplicator after win. While you have not lost yet (meaning
| | that since last "Big Win" you are on a straigh
Considering that I don't have unlimited money that would allow me to test it on a real dice betting site (duh), I have coded a simulation that allows me to run my algorithm in an environment that reproduces those websites.
Although I have not tested it in extreme conditions (really large number of rolls) it seems to work pretty well, and I never got my simulation going "out of bankroll" or even finish the algorithm with less bankroll than it started with.
I have commented this so it is clear to everyone what I was thinking and why is every operation doing.
```
public static void Main(string[] args)
{
simulation1(0.000001, 1.1, 1.09, 10.9, 0.01, 10);
}/* | | | | | L--> This is the number of "Big Wins" you want to play. The simulation will
| | | | | play until that number is reached.
| | | | L-------> This is your initial Balance. The simulation will stop and warn you if
| | | | any bet gets too big for your actualBalance, but you gotta start
| | | | with something.
| | | L-------------> This is The multiplicator after loss. Basically, when you lose, the
| | | next bet(s) will be multiplicated by this amount until you win again,
| | | which will be a "Big Win" and is gonna reset your iterations.
| | L------------------> This is the multiplicator after win. While you have not lost yet (meaning
| | that since last "Big Win" you are on a straigh
Solution
Random number generation
Your random number function has a big problem. It is currently reseeding itself to
To fix this, you should create a single
Your random number function has a big problem. It is currently reseeding itself to
DateTime.Now.Millisecond on each call. Assuming your program runs fairly quickly, this means that you will generate the same random number over and over until the time advances to the next millisecond. You can test this by printing out a series of random numbers and seeing what you get.To fix this, you should create a single
Random object from a single seed, and then reuse the same object to generate all of your random numbers.Context
StackExchange Code Review Q#138170, answer score: 3
Revisions (0)
No revisions yet.