Pages:
Author

Topic: PHP martingale bot for satoshiDICE - page 7. (Read 32838 times)

legendary
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
June 04, 2012, 11:38:47 PM
#34
And, equally importantly, the longer you postpone the house's win, the more the house wins. (Because with every wager you place, the house's expected profit goes up.)

I'm not sure I agree with this statement. I'm no statistical expert, but I believe what is being referred to here are called "independent events" in statistics, wherein each bet occurs independently of other bets. If you thus bet 9 times and win all 9 times, the 10th bet does not have any worse odds than the first, even though the house's odds have gotten out of whack.

In other words, if you "postpone" the house's win, there's no additional reason to not place the next bet. There is no "karma" in gambling. Every marginal bet has the same chance of you winning. Thus with every wager you place, the house's expected profit does NOT go up, but is the same each time no matter what.

Am I wrong or misunderstanding you Joel?
No, you're not wrong. It's just another way to view the same thing. Remember, your expected loses are proportional to your total bets. Thus the more you bet in total, the more you can expect to lose.

To put it another way, the more money you are trying to win or willing to lose when you do a Martingale, the more you can expect to lose.
legendary
Activity: 1008
Merit: 1021
Democracy is the original 51% attack
June 04, 2012, 07:55:21 PM
#33
And, equally importantly, the longer you postpone the house's win, the more the house wins. (Because with every wager you place, the house's expected profit goes up.)

I'm not sure I agree with this statement. I'm no statistical expert, but I believe what is being referred to here are called "independent events" in statistics, wherein each bet occurs independently of other bets. If you thus bet 9 times and win all 9 times, the 10th bet does not have any worse odds than the first, even though the house's odds have gotten out of whack.

In other words, if you "postpone" the house's win, there's no additional reason to not place the next bet. There is no "karma" in gambling. Every marginal bet has the same chance of you winning. Thus with every wager you place, the house's expected profit does NOT go up, but is the same each time no matter what.

Am I wrong or misunderstanding you Joel?
sr. member
Activity: 336
Merit: 254
CEO of Privex Inc. (www.privex.io)
June 04, 2012, 05:32:59 PM
#32
Be careful.

As other users have pointed out, no matter what strategy you use (including martingale progression), you can never overcome the casino's mathematical advantage (Law of Large Numbers). Over the long term the house always wins.
And, equally importantly, the longer you postpone the house's win, the more the house wins. (Because with every wager you place, the house's expected profit goes up.)

Indeed, careful folks Wink I was screwing around with a slightly modified version of this, bet small amounts over the course of a week and got up about 35 BTC. Then the smackdown came and lost 20 BTC in relatively quick succession. I decided to call it good and stop as I was still ahead. This is precisely what you would expect to happen. Over the long term, your expected return is ~98% or whatever, depending on the game, meaning if you play long enough, you will consistently lose 2%.

Have fun, be safe Smiley



this is almost my exact experience... very slow climb to +50, sudden smack down back to +30, and then quit about a week ago Cheesy

don't want to be one of those people who end up putting their car / their house on the line!

yeah, I went full retard, I got to 50BTC, went to 17BTC due to them doublespending me or some other bug, then I slowly climbed back to 50BTC... then BAM, huge loss streak on the 50% dice, which brought me to 0.
I'm now broke.
T_T
Note: if you wanna see these results: http://www.satoshidice.com/lookup.php?tx=1LnSD2xBieJQaKXS3EtjTdWUEhkct68jAU
Feel free to facepalm at my long loss streaks =_=
member
Activity: 93
Merit: 10
June 02, 2012, 02:17:38 AM
#31
Be careful.

As other users have pointed out, no matter what strategy you use (including martingale progression), you can never overcome the casino's mathematical advantage (Law of Large Numbers). Over the long term the house always wins.
And, equally importantly, the longer you postpone the house's win, the more the house wins. (Because with every wager you place, the house's expected profit goes up.)

Indeed, careful folks Wink I was screwing around with a slightly modified version of this, bet small amounts over the course of a week and got up about 35 BTC. Then the smackdown came and lost 20 BTC in relatively quick succession. I decided to call it good and stop as I was still ahead. This is precisely what you would expect to happen. Over the long term, your expected return is ~98% or whatever, depending on the game, meaning if you play long enough, you will consistently lose 2%.

Have fun, be safe Smiley

sr. member
Activity: 258
Merit: 250
June 01, 2012, 07:22:09 PM
#30
Python Version:

Win32 Binary, Source & Dependencies included.

http://www.mediafire.com/?sdlkfpgyxhcz7st
legendary
Activity: 2618
Merit: 1006
June 01, 2012, 05:29:23 PM
#29
In other words:
If you play more often, you give the house more chances to win.
legendary
Activity: 1596
Merit: 1012
Democracy is vulnerable to a 51% attack.
June 01, 2012, 05:16:43 PM
#28
Be careful.

As other users have pointed out, no matter what strategy you use (including martingale progression), you can never overcome the casino's mathematical advantage (Law of Large Numbers). Over the long term the house always wins.
And, equally importantly, the longer you postpone the house's win, the more the house wins. (Because with every wager you place, the house's expected profit goes up.)
legendary
Activity: 924
Merit: 1004
Firstbits: 1pirata
June 01, 2012, 12:46:36 PM
#27
interesting...
sr. member
Activity: 336
Merit: 254
CEO of Privex Inc. (www.privex.io)
June 01, 2012, 11:58:26 AM
#26
Here's my modified version with a few more sanity checks, it even waits for your balance to be confirmed.
I was testing it out and it worked great, but one issue was, I had it running so quickly, that I ran out of confirmed balance, and had nearly 2BTC unconfirmed, so I added a function to check whether you actually have enough balance confirmed to even send it, if not, it waits 1 minute, and repeats until you have enough balance.

Code:
require_once('jsonRPCClient.php');
/** BITCOIN **/
$btcu = array("user" => "",             // RPC Username
            
"pass" =>   "",               // RPC Password
            
"host" =>   "localhost",      // RPC Hostname/IP
            
"port" =>   9332);            // RPC Port
$b = new jsonRPCClient("http://{$btcu['user']}:{$btcu['pass']}@{$btcu['host']}:{$btcu['port']}");

define('MIN_BET'0.05);
define('MAX_BET'6);
define('ADDRESS''1dice97ECuByXAvqXpaYzSaQuPVvrtmz6');

$bet MIN_BET;
$total_fees 0;
$count 0;
$count_won 0;
while ((
$bet <= MAX_BET) && ($count_won 200))
{
        
$balance_a $b->getbalance('*'0);
        if (!isset(
$starting_balance)) $starting_balance $balance_a;
        if(
$b->getbalance('*'1) < $bet) { // If we don't have enough confirmed bitcoins to send to satoshi dice...
            
echo "Waiting for confirmed balance";
            while(
$b->getbalance('*'1) < $bet
            {
                echo 
".";
                
sleep(60); // Wait a full minute before checking the balance again.
            
}
            echo 
"\n";
        }
    
try // Wrapped in a try catch block just incase we run out of cash.
        
{
            
$b->sendtoaddress(ADDRESS, (float) $bet);
    
}
        catch(
Exception $e
        {
            echo 
"Have: " $b->getbalance('*'1) . " Needed: " $bet "\n";
    
die("Ran out of money?\n");
    
}
        
$balance_b $b->getbalance('*'0);
        
$count++;
        
$fee $balance_a $balance_b $bet;
        
$total_fees += $fee;
        
$total_fees number_format($total_fees,8,'.','')+0;

        echo 
'Game #'.$count."\n";
        echo 
'Balance: ' $balance_a."       ";
        echo 
'Bet: '$bet."       ";
        echo 
'Fee: '. (number_format($fee8'.''') +0) . "       ";
        echo 
'Total Fees: '$total_fees"\n";
        echo 
'Balance: ' $balance_b "       ".'Waiting';

        
$balance_c 0;

        while (
$balance_b >= $balance_c)
        {
        sleep(4);
$balance_c $b -> getbalance('*'0);
echo '.';
        }

        echo 
"\nBalance: $balance_c       ";

        
$diff $balance_c $balance_b;

        if (
$diff $bet)
        {
                
$bet MIN_BET;
                
$count_won++;
                echo 
"Win! ($count_won out of $count)\n";
        }
        else
        {
                
$bet *= 2;
                echo 
'Lose!'."\n";
        }

        echo 
"\n";
}

echo 
'Starting Balance: '.$starting_balance."\n";
echo 
'Ending Balance  : '$balance_c."\n";
echo 
'Total Fees: '$total_fees."\n";
$amt_won $balance_c $starting_balance;
echo 
'Net Profit: '. (number_format($amt_won,8,'.','') + 0). "\n\n";

?>

donator
Activity: 640
Merit: 500
May 14, 2012, 03:57:24 AM
#25
So yeah I made 3 btc, and today I lost it all, pretty neat script though, worked perfect Smiley
legendary
Activity: 1092
Merit: 1001
May 11, 2012, 12:03:12 AM
#24
The Jinx is a magical being (often hangs around 2-up games) who grows a little stronger every time someone bets based on 'patterns' occurring in independent events.
The Jinx sometimes gets upset when someone tries to credit its hard work to 'gamblers fallacy' - and may give a run of good luck to the pattern-better just to piss off that interfering logic-nerd!

newbie
Activity: 45
Merit: 0
May 10, 2012, 06:20:01 PM
#23

as stated on their website rules, you can send to more than one of their games at once via a single 'sendmany' transaction.


Good answer, thank you

To make amends I'll make my next question luckier, by only asking it if the hash of it (mod 65535) comes in below a satoshi throw.
legendary
Activity: 1414
Merit: 1000
HODL OR DIE
May 10, 2012, 12:44:49 PM
#22

 

warning: the martingale method of betting isn't foolproof. this script may cause you to lose your entire balance.
warning 2: even if the martingale method of betting were foolproof, my php code may not be... use at your own risk.

if you like this and want to send me a few bits for the effort, 1CxzfAQo2UK9rppeQNvNmAFhApPqmdVR8y Cheesy


I would demand a donation from SatoshiDice actually....  Grin

To ad to the warnings of this "system".
newbie
Activity: 45
Merit: 0
May 09, 2012, 02:31:55 PM
#21
what's all this then

mem
hero member
Activity: 644
Merit: 501
Herp Derp PTY LTD
May 09, 2012, 08:04:08 AM
#20
link to my simulator, https://bitcointalksearch.org/topic/m.889950

good for simulating 20'000+ rounds Smiley
hero member
Activity: 700
Merit: 507
May 09, 2012, 03:59:04 AM
#19
would use the RPC.. but havent figured out how to use that in MSH so far Wink Under Linux and PHP its not a real problem..
mem
hero member
Activity: 644
Merit: 501
Herp Derp PTY LTD
May 09, 2012, 03:50:50 AM
#18
im using the json API - I highly recommend it.

my pseudo code for determining if bet received.

Code:
# $last_bet = $bet;
# transaction_arr = get last N transactions;

# if($transaction_arr[0] < 0)
#   (negative number, sent transaction, loop and wait).
# else
#   must be a positive transaction, money recieved.
# $latest = $transaction_arr[0];

# confirm from address (satoshidice use same address for recieving and sending for each game).
# if($latest == $last_bet * $reward)
#   won, reset bets, loop
# else
# if ($latest == $last_bet * 0.004089)
#   lost, $bet *= $bet_multiplier, loop
hero member
Activity: 700
Merit: 507
May 09, 2012, 03:49:41 AM
#17
same thing.. i either get the confirmed balance or no balance ><
hero member
Activity: 700
Merit: 507
May 09, 2012, 03:29:38 AM
#16
That IS a problem i just noticed myself after running a few games.. i wonder - how can you get 0-Conf balances via command line
bitcoind getbalance '*' 0 returns 0.000000 for me

i don't know but i'm going to take a quick guess... have you tried without the single quotes?
bitcoind getbalance * 0


Everything just ends up with 0.00000 or "type mismatch" - only singlequotes worked so far... i keep trying and will update my script
hero member
Activity: 700
Merit: 507
May 09, 2012, 03:25:09 AM
#15
That IS a problem i just noticed myself after running a few games.. i wonder - how can you get 0-Conf balances via command line
bitcoind getbalance '*' 0 returns 0.000000 for me
Pages:
Jump to: