Bitcoin Forum
July 20, 2018, 03:37:26 PM
 News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 Home Help Search Donate Login Register
 Pages: [1]
 Author Topic: Quick and dirty python martingale calculator  (Read 738 times)
Eildosa
Member

Offline

Activity: 78
Merit: 10

 August 03, 2015, 01:18:15 PM

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) :
-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
1532101046
Hero Member

Offline

Posts: 1532101046

Ignore
 1532101046

1532101046
 Report to moderator
| pvp - pve - solo pve games | faucet |
Free satoshi code
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
LiQuidx
Hero Member

Offline

Activity: 546
Merit: 500

 August 03, 2015, 01:53:02 PM

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.

GiocareHost
Sr. Member

Offline

Activity: 266
Merit: 250

 August 03, 2015, 03:38:27 PM

But in the end its the luck rather than maths in gambling that matters.
Albeit I checked the script worked fine for me.
Dennis7777
Hero Member

Offline

Activity: 640
Merit: 500

 August 03, 2015, 03:46:09 PM

How to use (for windows, if you use linux you'r probably a techie anyway) :
-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.

 PRIMEDICE .   The Premier Bitcoin Gambling Experience  Most Trusted & Popular | Active Chat & Community | Free BTC Faucet | 1% Edge
anderson00673
Sr. Member

Offline

Activity: 308
Merit: 250

 August 03, 2015, 03:51:20 PM

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?
Eildosa
Member

Offline

Activity: 78
Merit: 10

 August 03, 2015, 06:45:31 PM

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?
Eildosa
Member

Offline

Activity: 78
Merit: 10

 August 03, 2015, 07:09:43 PM

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"
 Pages: [1]
 « previous topic next topic »