Martingale Strategy Calculator

Calculate betting strategy based on desired profit and number of rolls to target that profit. Console log has list of bets to be made.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
    // @name         Martingale Strategy Calculator
    // @version      1.0
    // @description  Calculate betting strategy based on desired profit and number of rolls to target that profit. Console log has list of bets to be made.
    // @description  See 
    // @description  Please sign up using my ref link:
    // @description  Would be happy about a donation when you make money with the script! > BTC
    // @author       rorg314
    // @match        https://freebitco.in/?op=home
    // @match        https://freebitco.in/?op=home#
    // @match        https://freebitco.in/
    // @match        https://freebitco.in/*
    // @require      http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js

// @namespace https://greasyfork.org/users/583382
// ==/UserScript==


//Config values//
var n = 1;
var betlast = 0;
var testbet = 0;
var nmax = 100;
var profit =0;
var rolls = 0;
var dprof = 0;
var cumsum = 0;
var minbet = [];
var cumsumarray = [];
var tries=0;
var testcum = 0;
var testprofit = 0;
var maxroll = 0;
//USER VALUES//
var odd = 5; //Desired odds
var npmax = 4; //Desired number of rolls win max profit
var iniprof = 100; // Desired max profit
var maxSpend = 500000; // Desired max spend before lose
//USER VALUES//

//FUNCTIONS//
//Test bet required to reach desired profit value (after n rolls)
function testprof() {
	testcum = cumsum;
	testbet=0;
	testprofit = odd*testbet-testcum;
	while(testprofit <= dprof){
	testbet++;
	testcum++;
	testprofit = odd*testbet-testcum;
	}
}
//Test the bet required on the n-th roll
function testn() {
	if(cumsum < maxSpend){
			if(n<=npmax){dprof = iniprof;} else {dprof = 1;} //switch to break even after npmax rolls
	testprof(); //Call testprof
	betlast = testbet;
	cumsum = cumsum + betlast;
	cumsumarray[n] = cumsum;
	minbet[n] = testbet;
	n++;
	}
    else{maxroll = n; nmax = n;}//stop if bet over max
}

while(n<nmax){ testn();}

console.log(minbet);
console.log('Max lose streak = ' + maxroll);