Fibonacci strategy#
from roulette import Roulette
from core import *
import matplotlib.pyplot as plt # type: ignore
from matplotlib.ticker import FuncFormatter
import statistics
from simulations_core import *
from simulations_plots_core import *
roulette = Roulette()
def transformation_on_win(bet_history):
if len(bet_history) > 2:
return bet_history[-3], bet_history[:-3]
else:
return 1, []
def transformation_on_loss(bet_history):
if len(bet_history) >= 2:
return sum(bet_history[-2:]), bet_history
if len(bet_history) == 1:
return 2, bet_history
if len(bet_history) == 0:
return 1, bet_history
The Fibonacci roulette strategy uses the Fibonacci sequence of numbers, named after the Italian mathematician who went by that name, to determine your next stake:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, etc.
In line with the sequence, each stake is the sum of the two stakes before. With each loss, you would progress to the next number in the sequence, and for each win you would go back two places, or back to the start if you haven’t progressed that far. As you can’t start betting from 0, you’d start from a ratio of 1 and continue from there.
def fibonacci_betting(goal_money_won, bet, money_limit):
return goal_money_betting_even_bet(roulette, goal_money_won, bet, transformation_on_loss,
transformation_on_win, money_limit)
money_histories = simulate_different_goal_money(
betting_type = fibonacci_betting,
goal_money_list = [10, 100, 500, 1000],
number_histories = 10000)
Analysis when the goal is to win 10 units#
mean_money_list, std_money_list = get_mean_and_std_of_histories(money_histories, 10)
plot_money_history(mean_money_list, std_dev=std_money_list, title='Simulations mean and std', log_values=True)
plot_money_histories(money_histories, 10)
plot_minimum_money(money_histories, 10, log_values=True)
Analysis when the goal is to win 100 units#
mean_money_list, std_money_list = get_mean_and_std_of_histories(money_histories, 100)
plot_money_history(mean_money_list, std_dev=std_money_list, title='Simulations mean and std', log_values=True)
plot_money_histories(money_histories, 100)
plot_minimum_money(money_histories, 100, log_values=True)
Analysis when the goal is to win 500 units#
mean_money_list, std_money_list = get_mean_and_std_of_histories(money_histories, 500)
plot_money_history(mean_money_list, std_dev=std_money_list, title='Simulations mean and std', log_values=True)
plot_money_histories(money_histories, 500)
plot_minimum_money(money_histories, 500, log_values=True)
Analysis when the goal is to win 1000 units#
mean_money_list, std_money_list = get_mean_and_std_of_histories(money_histories, 1000)
plot_money_history(mean_money_list, std_dev=std_money_list, title='Simulations mean and std', log_values=True)
plot_money_histories(money_histories, 1000)
plot_minimum_money(money_histories, 1000, log_values=True)