Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xandao-dev/monte-carlo-betting-simulations

A bunch of betting simulations using Monte Carlo method. Useful for showing how your bankroll will collapse (or not) over time by betting.
https://github.com/xandao-dev/monte-carlo-betting-simulations

betting betting-models binary-options blackjack casino kelly-criterion martingale monte-carlo monte-carlo-simulation roulette

Last synced: about 2 months ago
JSON representation

A bunch of betting simulations using Monte Carlo method. Useful for showing how your bankroll will collapse (or not) over time by betting.

Awesome Lists containing this project

README

        




Monte Carlo Betting Simulations


A collection of Monte Carlo simulations for betting strategies like the Martingale, D'Alembert, and much more. The project generates a series of plots for each strategy, and also generates a summary table of the results.




Explore the docs »


Report Bug
·
Request Feature

Table of Contents



  1. About The Project


  2. Usage

  3. Roadmap

  4. Contributing

  5. License

  6. Contact

## About The Project

Sample with the Fixed Bettor, Fixed Martingale, Fixed D'Alembert, Fixed Soros and Kelly Criterion in European Roulette, betting on red/black (same as odd/even or high/low).


It was run 20 simulations of 10000 bets each, for each strategy and the initial bankroll was 100$.



User Inputs for European Roulette
Fixed Bettor Strategy Plot
Fixed Bettor Strategy Result
Fixed Martingale Strategy Plot
Fixed Martingale Strategy Result
Kelly Criterion Strategy Plot
Kelly Criterion Strategy Result
Soros Strategy Plot
Soros Strategy Result
D'Alembert Strategy Plot
D'Alembert Strategy Result

### Features

* Template Method Design Pattern, so it's easy to add new strategies.
* Plots and summary table for each strategy.
* **List of strategies**:

* **Fixed Bettor** - Bet the same amount of money every time.
* **Percentage Bettor** - Bet a fixed percentage of the bankroll every time.
* **[Kelly Criterion](https://en.wikipedia.org/wiki/Kelly_criterion)** - Bet a percentage of the bankroll based on the probability of winning.
* **[Fixed Martingale](https://pt.wikipedia.org/wiki/Martingale)** - Double the bet every time you lose.
* **[Fixed Martingale Inverted](https://en.wikipedia.org/wiki/Martingale_(betting_system)#Anti-martingale)** - Also known as Anti-Martingale, double the bet every time you win.
* **Percentage Martingale** - Same as Fixed Martingale, but the bet is a percentage of the bankroll.
* **Percentage Martingale** with Kelly Percentage - Same as Percentage Martingale, but the percentage is calculated using the Kelly Criterion.
* **Percentage Martingale Inverted** - Same as Fixed Martingale Inverted, but the bet is a percentage of the bankroll.
* **Percentage Martingale Inverted with Kelly Percentage** - Same as Percentage Martingale Inverted, but the percentage is calculated using the Kelly Criterion.
* **Fixed Soros** - A strategy where you reinvests the winnings of the previous bet.
* **Percentage Soros** - Same as Fixed Soros, but the bet is a percentage of the bankroll.
* **Percentage Soros with Kelly Percentage** - Same as Percentage Soros, but the percentage is calculated using the Kelly Criterion.
* **Fixed Fibonacci** - A strategy where you bet the next number in the Fibonacci sequence, when you lose.
* **Fixed Fibonacci Inverted** - Also known as Anti-Fibonacci, it's a strategy where you bet the net number in the Fibonacci sequence, when you win.
* **Percentage Fibonacci** - Same as Fixed Fibonacci, but the bet is a percentage of the bankroll.
* **Percentage Fibonacci with Kelly Percentage** - Same as Percentage Fibonacci, but the percentage is calculated using the Kelly Criterion.
* **Percentage Fibonacci Inverted** - Same as Fixed Fibonacci Inverted, but the bet is a percentage of the bankroll.
* **Percentage Fibonacci Inverted with Kelly Percentage** - Same as Percentage Fibonacci Inverted, but the percentage is calculated using the Kelly Criterion.
* **[Fixed DAlembert](https://en.wikipedia.org/wiki/D%27Alembert_system)** - Increase or decrease the bet by 1 unit every time you win or lose, respectively.
* **Fixed DAlembert Inverted** - Also known as Anti-D'Alembert, increase or decrease the bet by 1 unit every time you lose or win, respectively.

### Built With

* [Python3](https://www.python.org/) - A general-purpose, high-level programming language
* [random](https://docs.python.org/3/library/random.html) - A library for generating random numbers
* [matplotlib](https://matplotlib.org/) - A comprehensive library for creating static, animated, and interactive visualizations
* [scipy](https://www.scipy.org/) - A Python-based ecosystem of open-source software for mathematics, science, and engineering

## Usage

1. Install the dependencies

```sh
pip install -r requirements.txt
```
2. Configure the input data in the [main.py](./main.py) file.

3. Comment or uncomment the strategies you want to run in the [main.py](./main.py) file.

3. Run the simulator

```sh
python3 main.py
```

## Roadmap

See the [open issues](https://github.com/xandao-dev/monte-carlo-betting-simulations/issues) for a list of proposed features (and known issues).

## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

Distributed under the MIT License. See [LICENSE](./LICENSE.md) for more information.

Free software =)

## Contact

Alexandre Calil - [Linkedin](https://www.linkedin.com/in/xandao-dev/) - [[email protected]](mailto:[email protected])

Project Link: [https://github.com/xandao-dev/monte-carlo-betting-simulations](https://github.com/xandao-dev/monte-carlo-betting-simulations)