Bitcoin Forum
May 26, 2019, 04:46:59 AM *
News: Latest Bitcoin Core release: 0.18.0 [Torrent] (New!)
 
   Home   Help Search Login Register More  
Pages: « 1 ... 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 [59] 60 »
  Print  
Author Topic: Seuntjie' Dice bot programmers mode discussion.  (Read 68213 times)
HCP
Legendary
*
Offline Offline

Activity: 980
Merit: 1508

<insert witty quote here>


View Profile
January 26, 2019, 09:01:58 PM
 #1161

Thanks for the help and formatting the code. I'm obviously not a programmer. I think you're right about the count4 being triggered. It works better now, but does reset to base after a few losses and a win. Can't really mess with it too much now, but will update if I figure it out. If anyone else wants to give it a go then the more the merrier.
That will be because of the count3 > 3 setting count2=0 setup.

So basically, if you get 3 losses in a row, followed by a win (with nextbet > 20), I think the conditions are setup that it will reset.

Based on your previous description of your algorithm...
Quote
What I'd like to do is set a condition where after one win followed by one loss and if the bet is above 20 units the bet resets to base. If it loses then a multiplier is added to the next bet. So if I have LLLWLW situation it will reset to base but only if the next bet is over 20 units.
Did you actually mean one loss followed by one win? Huh That is to say, you have the pattern xxxxxWLW? or did you mean that it should be xxxxLWL?

I don't see how LLLWLW is one win followed by one loss and then you check the bet size... as you've already completed a 3rd bet and won.

If you can clarify exactly what you're after, I think it shouldn't be too difficult to code up something.

1558846019
Hero Member
*
Offline Offline

Posts: 1558846019

View Profile Personal Message (Offline)

Ignore
1558846019
Reply with quote  #2

1558846019
Report to moderator
1558846019
Hero Member
*
Offline Offline

Posts: 1558846019

View Profile Personal Message (Offline)

Ignore
1558846019
Reply with quote  #2

1558846019
Report to moderator
"In a nutshell, the network works like a distributed timestamp server, stamping the first transaction to spend a coin. It takes advantage of the nature of information being easy to spread but hard to stifle." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
sleepyeyed
Newbie
*
Offline Offline

Activity: 15
Merit: 1


View Profile
January 26, 2019, 10:23:01 PM
Last edit: January 26, 2019, 11:16:42 PM by sleepyeyed
 #1162

Quote
xxxxxWLW

Yes, this. The LLL was just for demonstrative purposes.
HCP
Legendary
*
Offline Offline

Activity: 980
Merit: 1508

<insert witty quote here>


View Profile
January 27, 2019, 12:15:56 AM
 #1163

ok... so after a "WL"... if we have a win and nextbet is > 20, we should reset... else if we have a loss we should increase as per the multiplier...

This code should do that... it will ONLY reset to basebet if you get "WLW" sequence... and the nextbet is going to be > 20:
Code:
------------------------------------------------------------------------------
-- Script for sleeyeyed
-- by HCP
------------------------------------------------------------------------------
-- NOT TESTED THOROUGHLY, use at own risk.
------------------------------------------------------------------------------
basebet=10
nextbet=basebet
chance=33
previousResult1 = false
previousResult2 = false

function dobet()

  if win then
    nextbet=previousbet*.75
    if previousResult2 == true and previousResult1 == false and nextbet > 20 then
      -- WLW sequence with nextbet > 20, so reset to basebet
      nextbet = basebet
    end
  else
    nextbet=previousbet*1.15
  end

  if nextbet < 10 then
    nextbet = basebet
  end

  -- keep track of previous 2 results
  previousResult2 = previousResult1
  previousResult1 = win

end

sleepyeyed
Newbie
*
Offline Offline

Activity: 15
Merit: 1


View Profile
January 27, 2019, 01:19:57 AM
 #1164

Looks nice. I wont be able to run it until Monday, but I'll let you know how it works out when I do.
sleepyeyed
Newbie
*
Offline Offline

Activity: 15
Merit: 1


View Profile
January 28, 2019, 01:53:29 PM
Last edit: January 28, 2019, 05:26:29 PM by sleepyeyed
 #1165

Works great! Thanks HCP. Ok, so for some more fun could we add a condition where it will reset to base after a WLLW and a WLLLW situation at the same time that the WLW condition is also running? My mind is having trouble deciphering the logic here. I'm guessing there needs to be a previousResult3 and previousResult4 in there, but don't know how to place it correctly.
HCP
Legendary
*
Offline Offline

Activity: 980
Merit: 1508

<insert witty quote here>


View Profile
January 28, 2019, 07:11:22 PM
 #1166

If you are wanting to do that, it would probably be better to use a "table" to hold the last X results... rather than creating a bunch of similarly named variables. It'll be more flexible and provide for easier expansion.

Code:
------------------------------------------------------------------------------
-- Script v2 for sleeyeyed
-- by HCP
------------------------------------------------------------------------------
-- NOT TESTED THOROUGHLY, use at own risk.
------------------------------------------------------------------------------
basebet=10
nextbet=basebet
chance=33
streakTable = {}

function dobet()

  -- keep track of last 5 results
  for i=5,2,-1 do
      streakTable[i] = streakTable[i-1]
  end
  streakTable[1] = win

  if win then
    nextbet=previousbet*.75
    if (streakTable[2] == false and streakTable[3] == true and nextbet > 20) or
      (streakTable[2] == false and streakTable[3] == false and streakTable[4] == true and nextbet >20) or
      (streakTable[2] == false and streakTable[3] == false and streakTable[4] == false and streakTable[5] == true and nextbet >20) then
      -- WLW or
      -- WLLW or
      -- WLLLW sequence with nextbet > 20, so reset to basebet
      nextbet = basebet
    end
  else
    nextbet=previousbet*1.15
  end

  if nextbet < 10 then
    nextbet = basebet
  end

end

sleepyeyed
Newbie
*
Offline Offline

Activity: 15
Merit: 1


View Profile
January 28, 2019, 08:17:15 PM
 #1167

Nice. That's super elegant and works well. It's easy to modify too. Thanks again, you rock dude.
sleepyeyed
Newbie
*
Offline Offline

Activity: 15
Merit: 1


View Profile
January 29, 2019, 07:01:18 PM
 #1168

Now I've got another new idea unrelated to my previous one. Lets say I want to analyze a group of bets, 100 for instance, and I want to be able to bet a multiplier based on whether or not a certain profit has happened. So in 100 bets if there is 50 or more units of profit then nextbet=basebet otherwise nextbet=previousbet*multiplier for another 100 bets. Rinse and repeat.
seuntjie
Legendary
*
Offline Offline

Activity: 1575
Merit: 1034



View Profile WWW
January 29, 2019, 07:55:49 PM
 #1169

Now I've got another new idea unrelated to my previous one. Lets say I want to analyze a group of bets, 100 for instance, and I want to be able to bet a multiplier based on whether or not a certain profit has happened. So in 100 bets if there is 50 or more units of profit then nextbet=basebet otherwise nextbet=previousbet*multiplier for another 100 bets. Rinse and repeat.

Be sure to take a loot at the bet history functions on https://steemit.com/seuntjie/@seuntjie/dicebot-programmer-mode-tutorial-01-2-functions. For the query function, you need to specify the whole select statement.

HCP
Legendary
*
Offline Offline

Activity: 980
Merit: 1508

<insert witty quote here>


View Profile
January 29, 2019, 08:16:17 PM
 #1170

Are you talking about a snapshot of the current "profit" after 100 bets? or are you wanting to do something a little more complex?

If it is a simple "what is current profit after 100 bets" scenario, I would personally just have a counter and a "startBalance" variable...

Code:
... stuff ...
startBalance = balance
count = 0

function dobet()
 
  ...
 
  count = count + 1
  nextbet = previousbet * multiplier
  if count >= 100 then
    count = 0 -- reset counter
    -- check profit
    if balance - startBalance >= 50 then
      nextbet=basebet
      startBalance = balance -- reset "profit" base value
    end
  end

  ... other stuff ...

end

If it is something more complex, then the bet history functions might be a better idea.

sleepyeyed
Newbie
*
Offline Offline

Activity: 15
Merit: 1


View Profile
January 30, 2019, 12:32:05 AM
 #1171

That code will work for my purposes for now, but eventually I'd like to create something that can calculate the probabilities of wins or losses based on number of wins and also based on what numbers have come up. Then I'd adjust my multiplier and/or basebet based on the probabilities. I'm looking at the bet history functions and they're a bit over my head, but I am at least learning more as I go along.
HCP
Legendary
*
Offline Offline

Activity: 980
Merit: 1508

<insert witty quote here>


View Profile
January 30, 2019, 02:52:45 AM
 #1172

Personally, I believe that is somewhat flawed logic (basing your decisions on past results) and getting into "gamblers fallacy" territory... given that each roll is independent, the probabilities are (should be?) exactly what you choose for your "chance" (minus the house edge, of course). Wink Tongue

To make the most of those bet history functions, you're going to need an understanding of SQL queries (especially for getHistoryByQuery()) and/or the Dicebot Database schema.

A SQLite DB browser like this one will let you look through the database structure to get an idea of the data that is stored. As for SQL queries, there are plenty of tutorials available online to explain how "SELECT" statements work.

seuntjie
Legendary
*
Offline Offline

Activity: 1575
Merit: 1034



View Profile WWW
January 30, 2019, 06:41:28 AM
 #1173

Personally, I believe that is somewhat flawed logic (basing your decisions on past results) and getting into "gamblers fallacy" territory... given that each roll is independent, the probabilities are (should be?) exactly what you choose for your "chance" (minus the house edge, of course). Wink Tongue

To make the most of those bet history functions, you're going to need an understanding of SQL queries (especially for getHistoryByQuery()) and/or the Dicebot Database schema.

A SQLite DB browser like this one will let you look through the database structure to get an idea of the data that is stored. As for SQL queries, there are plenty of tutorials available online to explain how "SELECT" statements work.

+1

+1

+1

sleepyeyed
Newbie
*
Offline Offline

Activity: 15
Merit: 1


View Profile
January 30, 2019, 12:57:30 PM
Merited by HCP (1)
 #1174

I understand where you're coming from in regards to the gambler's fallacy. I would say however that there is something to be said about a certain equilibrium being maintained within a certain set of numbers when also taking standard deviation into account. In no way would I say that previous results dictate future ones, but I would say that betting with probabilities would more likely be beneficial rather than betting against them. Could be flawed logic on my part, but it's still interesting and fun to explore. I'm not out to create a bulletproof script, just one that maximizes the chances for survival based on statistical analysis. I do appreciate your input and the help you've given me with my code and will continue to learn more about LUA scripting. I'm not trying to set the world on fire or anything, it's just a fun rabbit hole I've recently discovered that seems to have no bottom.
sobir06
Newbie
*
Offline Offline

Activity: 15
Merit: 0


View Profile
January 30, 2019, 08:58:11 PM
 #1175

Personally, I believe that is somewhat flawed logic (basing your decisions on past results) and getting into "gamblers fallacy" territory... given that each roll is independent, the probabilities are (should be?) exactly what you choose for your "chance" (minus the house edge, of course). Wink Tongue

To make the most of those bet history functions, you're going to need an understanding of SQL queries (especially for getHistoryByQuery()) and/or the Dicebot Database schema.

A SQLite DB browser like this one will let you look through the database structure to get an idea of the data that is stored. As for SQL queries, there are plenty of tutorials available online to explain how "SELECT" statements work.

question.bet on DiceBot . the result would be the same. if you would bet on the site
HCP
Legendary
*
Offline Offline

Activity: 980
Merit: 1508

<insert witty quote here>


View Profile
January 31, 2019, 01:39:22 AM
 #1176

question.bet on DiceBot . the result would be the same. if you would bet on the site
The short, very generalised, answer would be "Yes".

The long answer would be it depends on the website and how it implements client seeds and/or your ability to change/specify them. But, generally speaking, if you're using the same seed and/or nonce in the bot as on the website, then yes the results would (should) be identical regardless of whether or not you used bot or web browser.


sleepyeyed
Newbie
*
Offline Offline

Activity: 15
Merit: 1


View Profile
February 06, 2019, 02:08:29 PM
 #1177

Anyone know if in the console there's a command to stop on a win when running a script or is stop() the only way to stop it?
HCP
Legendary
*
Offline Offline

Activity: 980
Merit: 1508

<insert witty quote here>


View Profile
February 06, 2019, 07:11:30 PM
 #1178

As far as I know, there is no stoponwin() function or anything like that... You have to code that into your script yourself.

Code:
if <insert some condition> then
  stop()
end

I've used a boolean flag before, to "stop on next win" etc...

Code:
...
stoponwin = false
...
function dobet()
  ...
  if (win) then
    if (stoponwin) then
      stop()
    end
  ...
  end
...
  if (profit > 0.001) then
    stoponwin = true
  end
...
end

sleepyeyed
Newbie
*
Offline Offline

Activity: 15
Merit: 1


View Profile
February 06, 2019, 07:43:17 PM
 #1179

Thanks. Might be useful, but I was hoping for a single command to type while my script was going. I find it odd that there's stop on win button available for the advanced mode, but not programmer mode.
HCP
Legendary
*
Offline Offline

Activity: 980
Merit: 1508

<insert witty quote here>


View Profile
February 06, 2019, 07:55:54 PM
 #1180

Well, technically that could also be used as "a single command to type while [your] script was going"... If you were to type:
Code:
stoponwin = true
on the console when the script is running... then on the next win, the script will stop.

In fact, that is how I generally use it. You don't even need the "if (profit)" check or anything other condition to set stoponwin for that matter... just the:
Code:
  if (win) then
    if (stoponwin) then
      stop()
    end
  end

Pages: « 1 ... 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 [59] 60 »
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!