Thursday, December 28, 2023

check

def simulate_scenario(starting_bet):
    bankroll = 100
    winning_multiplier = 6.6
    win_chance = 0.15 # 15%
    consecutive_losses_reset = 2

    # Variables to keep track of win streaks
    current_win_streak = 0
    longest_win_streak = 0
    ending_bankroll = 0

    # Simulate 10000 bets
    consecutive_losses = 0
    for _ in range(10000):
        # Place the bet
        if random.random() < win_chance: # Win
            bankroll += starting_bet * winning_multiplier
            starting_bet *= 2 # Increase the bet by 100% after a win
            consecutive_losses = 0 # Reset consecutive losses counter
            current_win_streak += 1
            if current_win_streak > longest_win_streak:
                longest_win_streak = current_win_streak
        else: # Loss
            bankroll -= starting_bet
            consecutive_losses += 1
            current_win_streak = 0 # Reset current win streak counter
            if consecutive_losses == consecutive_losses_reset:
                starting_bet = starting_bet - 0.002 if starting_bet > 0.002 else 0.001 # Decrease bet by 0.002 or set to minimum 0.001
                consecutive_losses = 0

    ending_bankroll = bankroll
    return ending_bankroll, longest_win_streak

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home