Author

Topic: Quick and dirty python martingale calculator (Read 859 times)

member
Activity: 572
Merit: 10
August 03, 2015, 02:09:43 PM
#7
allright it's much faster now with the possibility to set min profit for each draw.
I'm starting with 7 credit and a 15x payout

Code:
def martingale(current_bet, payout, profit):
    lost = 0
    x = 1
    while True:
        lost = lost + current_bet
        print "draw %s" %(x)
        print "lost %s" %lost
        while(((current_bet*payout-lost) + current_bet) < profit):
            current_bet = current_bet+1
        print "next bet : %s in order to win %s for a profit of %s" %(current_bet, current_bet*payout, current_bet*payout-lost)
        x = x + 1
        user_choice = raw_input("continue (c) / reset (r) : ")
        print "\n"
        if user_choice == "r":
            return

while True:
    print "================================================================"
    print "==================- dice martingale calculator -================"
    print "================================================================"
    current_bet = raw_input("initial_bet : ")
    payout = raw_input("payout : ")
    profit = raw_input("profit for each draw : ")
    martingale(int(current_bet), int(payout), int(profit))
    print "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
    print "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
member
Activity: 572
Merit: 10
right now I'm experimenting with coinroyal's free credit (discovered dice games yesterday)

I'm using a 6.6% chance in order to get a 15x payout.
the longest loosing strike I got was a 31 draw.
Always rolling high.

I think I'm going to change the script in order to get at least 100 of profit for each draw, may be I'll make a bot.

It's funny to do, but as said, math state that at one point I will loose everything, so is a bot really required?
sr. member
Activity: 308
Merit: 250
Just curious, what success have you had (the op) with martingale?  I assume from your post that you are not playing a straight up 50/50, but some other odds like 80/20?  Or something like that?  You play it on dice right?
hero member
Activity: 640
Merit: 500
How to use (for windows, if you use linux you'r probably a techie anyway) :
-install python 2.7 : https://www.python.org/downloads/release/python-2710/
-create a new environment variable called PYTHON_HOME pointing to C:\Python27 (or wherever you installed it)
-add this to the PATH environment variable ;%PYTHON_HOME%;%PYTHON_HOME%\Scripts
-create a script.py and open it with notepad, paste the script inside
-shift plus right clic in the folder where the script is and select open a cmd windows here
-type : nameOfScript.py and press enter

Explanation :
1/ you installed python in order to run the script
2/ creating this environment variable allow you to just type the name of the script in the command line instead of "C:\Python27\python.exe nameOfTheScript.py"

the script begin and it should be user friendly enought

For those not so familiar with python or programming, they can also run the code on http://www.tutorialspoint.com/execute_python_online.php easily.
sr. member
Activity: 266
Merit: 250
But in the end its the luck rather than maths in gambling that matters.
Albeit I checked the script worked fine for me.
hero member
Activity: 546
Merit: 500
Hi,

I know that you can get a loosing strike and hit your bankroll limit, but somehow I feel safe playing martingale.
I made this script 10 minutes ago, since in dice you don't always need to double after a loss, it depends of
what the payout is.

Code:
def martingale(current_bet, payout):
    lost = 0
    x = 1
    while True:
        lost = lost + current_bet
        print "draw %s" %(x)
        print "lost %s" %lost
        while(current_bet*payout<=lost):
            current_bet = current_bet+1
        print "next bet : %s in order to win %s for a profit of %s" %(current_bet, current_bet*payout, current_bet*payout-lost)
        x = x + 1
        user_choice = raw_input("continue (c) / reset (r) : ")
        print "\n"
        if user_choice == "r":
            return

while True:
    print "================================================================"
    print "==================- dice martingale calculator -================"
    print "================================================================"
    current_bet = raw_input("initial_bet : ")
    payout = raw_input("payout : ")
    martingale(int(current_bet), int(payout))
    print "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
    print "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"

Do what you want with it.

I'm sure that a lot of people don't know what are the pre-requisites and how to run a python script so it would be a nice idea if you include some kind of info about it. Smiley
member
Activity: 572
Merit: 10
Hi,

I know that you can get a loosing strike and hit your bankroll limit, but somehow I feel safe playing martingale.
I made this script 10 minutes ago, since in dice you don't always need to double after a loss, it depends of
what the payout is.

Code:
def martingale(current_bet, payout):
    lost = 0
    x = 1
    while True:
        lost = lost + current_bet
        print "draw %s" %(x)
        print "lost %s" %lost
        while(current_bet*payout<=lost):
            current_bet = current_bet+1
        print "next bet : %s in order to win %s for a profit of %s" %(current_bet, current_bet*payout, current_bet*payout-lost)
        x = x + 1
        user_choice = raw_input("continue (c) / reset (r) : ")
        print "\n"
        if user_choice == "r":
            return

while True:
    print "================================================================"
    print "==================- dice martingale calculator -================"
    print "================================================================"
    current_bet = raw_input("initial_bet : ")
    payout = raw_input("payout : ")
    martingale(int(current_bet), int(payout))
    print "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
    print "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"

Do what you want with it.

How to use (for windows, if you use linux you'r probably a techie anyway) :
-install python 2.7 : https://www.python.org/downloads/release/python-2710/
-create a new environment variable called PYTHON_HOME pointing to C:\Python27 (or wherever you installed it)
-add this to the PATH environment variable ;%PYTHON_HOME%;%PYTHON_HOME%\Scripts
-create a script.py and open it with notepad, paste the script inside
-shift plus right clic in the folder where the script is and select open a cmd windows here
-type : nameOfScript.py and press enter

Explanation :
1/ you installed python in order to run the script
2/ creating this environment variable allow you to just type the name of the script in the command line instead of "C:\Python27\python.exe nameOfTheScript.py"

the script begin and it should be user friendly enought
Jump to: