Optimal Profit 999Dice #MyDiceBot#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Sleep function | |
function sleep(n) | |
t0 = os.clock() | |
while os.clock() - t0 <= n do end | |
end | |
-- Init Globals | |
basebet = balance * 100e-8 -- Satoshi Base (BTC ONLY) 0.00000100 use 10e-8 for small bal | |
chance = 50 | |
edge = 0.15 -- Big edge; base is 0.1 - 999Dice edge | |
targetprofit = balance * 1.15 | |
profitpct = 1.001 -- .1% increase in profit | |
base2 = basebet | |
nextbet=base2 | |
balanceamt = balance | |
function dobet() | |
if math.random(1, 3) % 2 == 0 then | |
bethigh = true | |
else | |
bethigh = false | |
end | |
chance = math.random(40,45) | |
newchance = chance | |
edge = 0.15 | |
odds = (100-edge)/newchance | |
multi = odds/(odds-1) | |
chance2 = (100-edge)/odds | |
probability = chance2/100 | |
kellyratio = ((probability*odds) + (probability-1))/odds | |
kellybet = basebet * kellyratio | |
tg = kellybet | |
nextbet = kellybet | |
multi = odds / (odds-1) | |
mt = 1 | |
dvdr = 1 / multi | |
stopratio = previousbet/balanceamt | |
if balance >= targetprofit then | |
stop() | |
print ("Profit reached: " .. string.format("%.8f", profit)) | |
end | |
if (win) then | |
if profit > tg then | |
tg = profit * profitpct | |
nextbet = kellybet | |
end | |
if currentstreak >= 2 then | |
nextbet = kellybet | |
end | |
if profit >= 0 then | |
mt = 1*multi | |
else | |
mt = -1*multi | |
end | |
--[[if stopratio > 0.4 then | |
stop() | |
end]] | |
nextbet = profit * mt * edge + base2 | |
end | |
if (!win) then | |
if currentstreak <= -1 then | |
nextbet = base2*(dvdr^currentstreak) | |
end | |
if currentstreak == 1 then | |
nextbet = wagered*multi | |
end | |
if profit >= 0 then | |
mt = 1*multi | |
else | |
mt = -1*multi | |
end | |
nextbet = previousbet * (chance/22) | |
--[[if stopratio > 0.4 then | |
stop() | |
end]] | |
if nextbet >= profit then | |
base2 = previousbet * edge + base2 | |
end | |
end | |
--[[if profit >= targetprofit*1.03 then | |
resetseed() | |
elseif profit >= targetprofit*1.06 then | |
resetseed() | |
end]] | |
sleep(1) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment