Coder Social home page Coder Social logo

betting_simulator's Introduction

Betting Simulator

README English | 中文

Betting Simulator is a program that aims at helping people study different betting strategies.

Where the idea comes from?

A few years ago, a friend of mine told me he earned a few thousand dollars from betting with the help from his algorithm. The algorithm, simply speaking, was --- once a gambler lost a bet, the betting amount for the next round would be doubled, through which the lost from the previous game could be covered. The assumption behind this algorithm was every single bet was an independent incident, therefore the probability of losing continuously for n times was P(lose)^n. As soon as the gambler won a bet, all lose could all be covered , or even earned a few more coins because the possibility of losing continuously for n times was relatively low.

Another friend told me a similar algorithm when we had lunch together. The only difference would be he was doing online gambling rather than betting with this algorithm. He earned a bit at the beginning but lost all his money at the end. My thought at that time was online gambling was irrational because the betting rate could be set artificially but it did not mean the algorithm could not be applied.

One year later, the World Cup held every 4 years finally arrived. I opened a TAB account by chance, beginning my journey of betting. Let’s get started from my achievement. From 17th June, the initial investment was $100 and the final balance displayed in my account on 8th July was $168.85, with the rate of return of 68.85%.

Within less than a month, I kept betting frequently almost every single day. Every single bet was not huge, basically around 10% of the principal, therefore I did not earn much from a single bet. The thing that I cared about was whether the algorithm was effective or not rather than making profit. Don’t look down on the 68% return rate. If there is a 50% steady increase for every month, then after one year, the principal will be (1+0.5)^12, which is 130 times! Hence the initial $100 becomes $13K after a year, which will turn out to be $218,416,400 🤑🤑🤑 in three years. It feels like the financial independence is waving at you, doesn’t it? However, something deep inside tells me that something is a bit weird, because it is too good to be true. But I can’t tell what’s wrong, so I come up with an idea to verify the profitability of this algorithm using programming.

Installation

pip3 install -r requirements.txt

Usage

  1. Download this project to local and point Mac Terminal or Windows Command Line to the project folder. E.g:
cd /betting/
  1. Run the program by executing this command:
python3 start.py

or

python start.py

Configuration

This program stores and reads your settings in config.py. Modify values in the following files to manipulate the program behaviour.

betting_data_settings

This setting stores betting data config for the program.

Key Description Example
shuffle whether to shuffle betting data True

betting_settings

This setting stores betting config for the program.

Key Description Example
strategy the name of the strategy to be used double_betting_after_lossing
initial_money the initial money before betting 10000
initial_bet the initial money for first betting 100

visualization_setting

This settings stores visualization information.

Key Description Example
plugin the visualization plugin name money_history
title the title of the generated picture betting history
file the destination to store the image file \simulation_result\visualization\double_betting_after_lossing.html

betting_simulator's People

Contributors

xinbadev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.