Pages:
Author

Topic: memtingale simulator (Read 4944 times)

mem
hero member
Activity: 644
Merit: 501
Herp Derp PTY LTD
July 11, 2013, 12:00:17 AM
#24
hey people are still using my script Cheesy glad to see it.

It's the best customizable simulator around for that matter.

By the way, your gambling list is the most professional around too.

I liked the criterions that you chose in order to order the casinos.

Anonymous Casinos + BTC = more transparency needed

Keep up the good work!

flattery will get you everywhere Smiley

I also write/ wrote:

namefix.pl: the best batch file renamer (linux, mac, win)
wiicr: day 0 / first homebrewer* to allow playing mp3's and videos via the nintendo wii
arby.pl: an arbitrage calculator for BTC-e, offline currently as it was chewing resources Tongue
FYGP: Fuck Your Group Policy - a very handy app that is damn near impossible to uninstall (on purpose) and auto installs every time its executed (yer it acts like a virus). Its entire point being to over ride desktop backgrounds on domain workstations (a company I worked at forced a horrible bright white and green bg).

and thats just what I bother to share Wink
when you release a free app or script quite often you are hounded for support so I keep many of my hacks to myself Wink

This script was an ugly hack as well, but I used it to develop my own version of the martingale system which I have played to good success (won heaps and never used it again). I released this one because it seemed to many players failed to see the pitfalls of martingales system.
hero member
Activity: 640
Merit: 771
BTC⇆⚡⇄BTC
July 10, 2013, 08:27:27 PM
#23
hey people are still using my script Cheesy glad to see it.

It's the best customizable simulator around for that matter.

By the way, your gambling list is the most professional around too.

I liked the criterions that you chose in order to order the casinos.

Anonymous Casinos + BTC = more transparency needed

Keep up the good work!
mem
hero member
Activity: 644
Merit: 501
Herp Derp PTY LTD
July 10, 2013, 07:48:35 AM
#22
mem personal question what is your race

NASCAR !!!!
mem
hero member
Activity: 644
Merit: 501
Herp Derp PTY LTD
July 10, 2013, 07:41:39 AM
#21
hey people are still using my script Cheesy glad to see it.
hero member
Activity: 640
Merit: 771
BTC⇆⚡⇄BTC
July 05, 2013, 03:00:41 PM
#20
Thank you again!
hero member
Activity: 728
Merit: 500
July 05, 2013, 08:08:51 AM
#19
Quote
Make the code keep track of how often a 0 is rolled and how often it ends up with a 1. Compare these numbers and they should be close to 50% with a large enough run (In a run with 1 milion samples, with 95% certainty, the percentage of zeroes should fall between 49.8% and 50.2%).

Btw, is that simple to implement?

Sorry I'm damn noob programming that kind of stuff yet...  Undecided

I don't have experience with Perl (the language used for Mems script), but since I have used plenty of other languages, it should be straightforward. A slightly modified version of the script posted by Mem:

Code:
#!/usr/bin/perl -w
#copyright [email protected] , License http://www.gnu.org/licenses/gpl.html

$incr = 2.5;
$win = 0;

$num_wins = 0;
$num_losses = 0;

$bet_start = 0.03;
$bet1=$bet_start;
$bet1_cum=0;
$bet1_profit=0;
$bet1_win=0;
$bet1_cum_win=0;
$bet1_reset=0;

$pot=3000; # amount of cash we have to play with

$table_max=100;
$hitmax=0; # should we goto table max before reseting if next bet would be greater than table max

# reset bets if we have won N amount recently.
# the idea is it stops the odds getting out of control and simulates seprate games if you played to N amount each time

$profit = 0;

$count=20000;
$c=0;

$b1="";

$lose_multiplier = 0.004089;
$win_multiplier = 1.984;

$win_factor = 3;

$r=rand;
$outfile = "/tmp/gamblingsim.$r.html";
$log_outfile = "/tmp/gamblingsim.$r.log";

open(FILE, ">$outfile") or die "couldnt open html file $!\n";
open(FILE_LOG, ">$log_outfile") or die "couldnt open log file $!\n";

$headercount=0;
$header =
"

#
rand
Bet
win
cum
cum win
Profit

";

print FILE
"


Max rounds to play: $count
Pot: \$$pot
table_max \$$table_max

Win Factor Potx$win_factor

bet increment multiplier $incr

Hit table max bet ?: $hitmax




$header
";

for($c=0;$c<$count;$c++)
{
$bet1_win = 0;
$bet1_cum += $bet1;

$rand = int(rand(2)); # 0 = win, 1 = lose

# bet wins
$bet1_win = 0;
if($rand == 0)
{
$bet1_win = $bet1 * $win_multiplier;
                $num_wins++;
}
else
{
$bet1_win = $bet1 * $lose_multiplier;
                $num_losses++;
}
$bet1_cum_win += $bet1_win;

# calculate profits etc

$bet1_profit = $bet1_cum_win - $bet1_cum;
$profit = $bet1_profit;

# ========================
# End Game Checks

if($profit < (0-$pot)) # check to see if we are out of money
{
$lose = 1;
last;
}

# stop if hit target profit
if($profit > ($pot * $win_factor))
{
$win=1;
last;
}

# html stuff
# set html table colours

$headercount++;
if($headercount>10)
{
print FILE $header;
$headercount=0;
}

if($rand == 0)
{
$r_col = "green";
}
elsif($rand == 1)
{
$r_col = "red";
}

# bold profit when we are at a posiive balance
if($profit > 0)
{
$b1 = "";
$b2 = "
";
}
else
{
$b1 = $b2 = "";
}

# output results to csv file
print FILE_LOG "$c,$bet1,$bet1_profit\n";

# output results to html file
print FILE
"










";

#####################################################
# SET BETS FOR NEXT ROUND

# increment bet amounts if didnt win last bet.
$bet1*= $incr;

if($rand == 0)
{
$bet1 = $bet_start;
}

# TABLE MAX, reset bets

if($bet1_reset == 1)
{
$bet1=$bet_start;
$bet1_reset=0;
}

if($bet1>$table_max)
{
if($hitmax)
{
$bet1=$table_max;
$bet1_reset =1;
}
else
{
$bet1=$bet_start;
}
}
}

if($lose)
{
print FILE "


";
}

if($win)
{
print FILE "


";
}
print FILE "
$b1$c$b2$b1$rand$b2$b1$bet1$b2$b1$bet1_win$b2$b1$bet1_cum$b2$b1$bet1_cum_win$b2$b1$bet1_profit$b2


LOSE




WIN FACTOR $win_factor ACHIVED



# of wins: $num_wins
# of losses: $num_losses";
close(FILE);
close(FILE_LOG);

#system("/home/mem/apps/gambling/chartit.pl $log_outfile");
#system("firefox $outfile && firefox $log_outfile.png");
system("firefox $outfile");

sleep(1);

exit 0;

In addition to doing all the usual stuff, this modified script also keeps track of the total number of wins (random number = 0) and losses (random number = 1) and adds that to the output file.
hero member
Activity: 640
Merit: 771
BTC⇆⚡⇄BTC
July 05, 2013, 04:33:03 AM
#18
Quote
Make the code keep track of how often a 0 is rolled and how often it ends up with a 1. Compare these numbers and they should be close to 50% with a large enough run (In a run with 1 milion samples, with 95% certainty, the percentage of zeroes should fall between 49.8% and 50.2%).

Btw, is that simple to implement?

Sorry I'm damn noob programming that kind of stuff yet...  Undecided
hero member
Activity: 640
Merit: 771
BTC⇆⚡⇄BTC
July 05, 2013, 04:29:45 AM
#17
@Rannasha

Thanks for the help.

I guess I got a little confused with that codes and didn't pay so much attention to that.

Now it's working fine: every simulation shows a complete disaster in terms of bankroll.  Grin
hero member
Activity: 728
Merit: 500
July 05, 2013, 04:10:15 AM
#16
One funny stuff: I've just simulated some neutral expected value (0EV) scenarios changing the following lines.
Code:
$lose_multiplier = 0; #  0EV

Then I ran a million bets and got profit as a result every time considering that:
Code:
$incr =  2.2; # always > 2
$bet_start = 0.5; # 0.5% of bankroll.
$pot=100;
$table_max=2.42; # 3rd and last consecutive bet.
$hitmax=1; # resets after 3rd consecutive loss.
$win_multiplier = $incr; # no house's edge / vig / juice.
Your win_multiplier is 2.2 (equal to $incr). That means you're simulating a game where if you win a coinflip, you get 2.2 your bet back (and 0 if you lose). That's a positive EV for the better in any circumstance (no need to martingale it, just straight up bet 1 unit at a time and watch profits rise).

For a no house edge game, you need to set $win_multiplier to 2.

Quote
So I ask you, do that functions...
Code:
$r=rand;
$rand = int(rand(2)); # 0 = win, 1 = lose

...really give us 50% rate (win/lose) as expected?

It seems like I got over 50% winning rate.
Make the code keep track of how often a 0 is rolled and how often it ends up with a 1. Compare these numbers and they should be close to 50% with a large enough run (In a run with 1 milion samples, with 95% certainty, the percentage of zeroes should fall between 49.8% and 50.2%).
hero member
Activity: 640
Merit: 771
BTC⇆⚡⇄BTC
July 05, 2013, 03:54:54 AM
#15
@mem

Thank you so much for creating that perl script.

I've been looking for a customizable martingale simulator tool like that for so long.

It really adds up to my statistical studies and math scraps as well.

One funny stuff: I've just simulated some neutral expected value (0EV) scenarios changing the following lines.
Code:
$lose_multiplier = 0; #  0EV

Then I ran a million bets and got profit as a result every time considering that:
Code:
$incr =  2.2; # always > 2
$bet_start = 0.5; # 0.5% of bankroll.
$pot=100;
$table_max=2.42; # 3rd and last consecutive bet.
$hitmax=1; # resets after 3rd consecutive loss.
$win_multiplier = $incr; # no house's edge / vig / juice.

I was hoping for a near no-profit / no-loss situation due to the Law of Large Numbers but got profit in all situations simulated.

Isn't that strange?

So I ask you, do that functions...
Code:
$r=rand;
$rand = int(rand(2)); # 0 = win, 1 = lose

...really give us 50% rate (win/lose) as expected?

It seems like I got over 50% winning rate.

Maybe the algorithm is not that fair enough.

Very strange though...
mem
hero member
Activity: 644
Merit: 501
Herp Derp PTY LTD
April 29, 2013, 02:37:29 AM
#14
We decided to refine on mem's excellent idea and crafted our own simulator. It's now online at http://botdice.com. There are quite a bunch of options to control a more interesting bet progression schedule. Plain Martingale is for dummies Tongue

How flattering Cheesy

Glad people like it.
hero member
Activity: 566
Merit: 500
March 29, 2013, 01:41:51 PM
#13
There's a separate thread for issues, please use that at https://bitcointalksearch.org/topic/botdice-online-simulator-play-100k-just-dice-satoshidice-rounds-for-free-160852

Could you paste your bet settings from the result page, and a snippet of erroneous rows, it's quite difficult to make sense of what's wrong otherwise. Yes there probably are errors in the code at this stage.

Quote
Then max increase amount is based on balance of bank or amount of bank at risk for the game.
Increase amounts are currently only static. You can't have everything at first sight  Wink
full member
Activity: 137
Merit: 100
I was thinking Stay Puft, but Gozer said Grover
March 29, 2013, 01:11:27 PM
#12
We decided to refine on mem's excellent idea and crafted our own simulator. It's now online at http://botdice.com. There are quite a bunch of options to control a more interesting bet progression schedule. Plain Martingale is for dummies Tongue

Cool idea.

Original post moved here: https://bitcointalksearch.org/topic/botdice-online-simulator-play-100k-just-dice-satoshidice-rounds-for-free-160852
hero member
Activity: 566
Merit: 500
March 29, 2013, 11:57:40 AM
#11
We decided to refine on mem's excellent idea and crafted our own simulator. It's now online at http://botdice.com. There are quite a bunch of options to control a more interesting bet progression schedule. Plain Martingale is for dummies Tongue
full member
Activity: 137
Merit: 100
I was thinking Stay Puft, but Gozer said Grover
March 28, 2013, 02:03:03 AM
#10
Yeah I saw the warning and I ignored it cause I roll that way.
Quote
Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

mem thanks for the sim.  It helped me change my perspective on gambling at SD.  Now instead of betting for the wins I bet small to find the losses and then hopefully have the room to memingdale my bets till I find all the consecutive losses and get a win.

you mean like bet 0.01 to catch a run of 5-6 losses, and then start betting big to increase your chances of winning?

that is fucking retarded

Yeap. I was doing martingale but starting too high.  Now I do a smaller start and increase by over 2, so when I find the next win I win more than what my first small win would have been if it was not a loss.

And good thing you've found a use for your lack of talent.

Holy shit, you are actually serious. Although it may appear comforting, your strategy makes no sense. Please don't think I am trolling you, I really am somewhat concerned that you actually believe this.

See this for a start:
http://en.wikipedia.org/wiki/Markov_property

If you have any questions or would like me to convince you further, please ask. I would be happy to elaborate in as much detail as needed. Perhaps someone else can chime in too. This is gambler's fallacy 101.



It's called GAMBLING!

Yes I'm full well aware that I am just as likely to lose enough bets in a row so that I no longer have the funds from which to double my bet.

It was playing with the sim that showed me I was not taking into account enough iterations.

Again, It's called GAMBLING!

Plus it's exciting.  I've increased my starting amount 4x, and who knows I may lose all of it when SD is back up.

Oh yeah. It's called GAMBLING!
member
Activity: 115
Merit: 10
March 28, 2013, 12:10:23 AM
#9
[deleted]
full member
Activity: 137
Merit: 100
I was thinking Stay Puft, but Gozer said Grover
March 27, 2013, 05:10:58 PM
#8
Yeah I saw the warning and I ignored it cause I roll that way.
Quote
Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

mem thanks for the sim.  It helped me change my perspective on gambling at SD.  Now instead of betting for the wins I bet small to find the losses and then hopefully have the room to memingdale my bets till I find all the consecutive losses and get a win.

you mean like bet 0.01 to catch a run of 5-6 losses, and then start betting big to increase your chances of winning?

that is fucking retarded

Yeap. I was doing martingale but starting too high.  Now I do a smaller start and increase by over 2, so when I find the next win I win more than what my first small win would have been if it was not a loss.

And good thing you've found a use for your lack of talent.
member
Activity: 115
Merit: 10
March 27, 2013, 03:32:53 PM
#7
[deleted]
full member
Activity: 137
Merit: 100
I was thinking Stay Puft, but Gozer said Grover
March 26, 2013, 06:06:47 PM
#6
Yeah I saw the warning and I ignored it cause I roll that way.
Quote
Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

mem thanks for the sim.  It helped me change my perspective on gambling at SD.  Now instead of betting for the wins I bet small to find the losses and then hopefully have the room to memingdale my bets till I find all the consecutive losses and get a win.
mem
hero member
Activity: 644
Merit: 501
Herp Derp PTY LTD
May 09, 2012, 06:50:29 AM
#5
Code:
$bet1_cum=0;

damn you I needed that spot Tongue

and yes, funny name - but on private releases its whatever is short, obvious and easy to type.
Pages:
Jump to: