def color_number_for(steal, fold_percentage, hand):
    three_bet_value = three_bet_equity(hand,
                                       steal=steal,
                                       fold_percentage=fold_percentage)
    fold_value = -1
    call_value = call_equity(hand, steal)
    return color_number(fold_value, call_value, three_bet_value)
def diff_three_bet_with_fold(steal, fold_percentage):
    three_bet_value = three_bet_equity(Hand(name='54o', combos=16),
                                       steal=steal,
                                       fold_percentage=fold_percentage)
    if three_bet_value is None:
        return None
    return three_bet_value - fold_equity()
def generate_hand_properties(steal, fold_percentage):
    for card1, card2, possible_suit in possible_hands():
        index1 = possible_cards.index(card1)
        index2 = possible_cards.index(card2)
        if possible_suit == 's':
            index1, index2 = index2, index1
        hand = Hand(name=card1 + card2 + possible_suit,
                    combos=combos_of[possible_suit])
        yield {
            "name":
            hand.name,
            "i":
            13 - index1,
            "j":
            13 - index2,
            "call_value":
            call_equity(hand, steal=steal),
            "three_bet_value":
            three_bet_equity(hand=hand,
                             steal=steal,
                             fold_percentage=fold_percentage),
            "steal":
            steal,
            "fold_percentage":
            fold_percentage,
        }
Beispiel #4
0
def equities(steal, fold_percentage, hand):
    three_bet_value = three_bet_equity(hand,
                                       steal=steal,
                                       fold_percentage=fold_percentage)
    fold_value = -1
    call_value = call_equity(hand, steal)
    return fold_value, call_value, three_bet_value
Beispiel #5
0
def test_call_equity():
    for s in range(5, 100, 5):
        call_value = call_equity(Hand(name='54o', combos=16), steal=s)
        assert call_value < 0

        three_bet_value = three_bet_equity(Hand(name='54o', combos=16),
                                           steal=s,
                                           fold_percentage=100)
        assert three_bet_value == 2.5
def hover_text_of(hand, steal, fold_percentage):
    call_value = round(call_equity(hand=hand, steal=steal), 3)
    three_bet_value = round(
        three_bet_equity(hand=hand,
                         steal=steal,
                         fold_percentage=fold_percentage), 3)
    return f'Steal: {str(steal)}%<br>' \
           f'Fold to 3bet: {str(fold_percentage)}%<br>' \
           f'<br>' \
           f'Call equity: {str(call_value)}<br>' \
           f'3bet equity: {str(three_bet_value)}'
def text_of(hand, steal, fold_percentage):
    three_bet_value = three_bet_equity(hand,
                                       steal=steal,
                                       fold_percentage=fold_percentage)
    fold_value = -1
    call_value = call_equity(hand, steal)
    if call_value >= -1 and call_value >= three_bet_value:
        return 'C'
    elif three_bet_value >= -1 and three_bet_value >= call_value:
        return '3B'
    else:
        return 'F'
def equities_of(hand_name, steal, fold3bet, fourbet, oop_penalty, steal_size,
                threebet_size):
    fold_equity = -1
    hand = Hand(name=hand_name, combos=combos_of[hand_name[2:]])
    return {
        "x":
        call_equity(hand, steal, oop_penalty, steal_size) - fold_equity,
        "y":
        three_bet_equity(hand=hand,
                         steal=steal,
                         fold_percentage=fold3bet,
                         fourbet=fourbet,
                         oop_penalty=oop_penalty,
                         steal_size=steal_size,
                         threebet_size=threebet_size) - fold_equity,
        "hand":
        hand_name
    }
Beispiel #9
0
f_range = range(20, 80, 2)
s_range = range(40, 100, 4)

z_values = [[
    round(equities(steal=s, fold_percentage=f, hand=hand)[2] + 1, 3)
    for f in f_range
] for s in s_range]

z_text = [[
    str(round(equities(steal=s, fold_percentage=f, hand=hand)[2] + 1, 1))
    for f in f_range
] for s in s_range]
hover_text = [[
    'Call equity: ' + str(round(call_equity(hand=hand, steal=s), 3)) +
    '3bet equity: ' +
    str(round(three_bet_equity(hand=hand, steal=s, fold_percentage=f), 3))
    for f in f_range
] for s in s_range]

data = [
    go.Scatter(x=[f for f in f_range for s in s_range],
               y=[s for f in f_range for s in s_range],
               text=[str(f + s) for f in f_range for s in s_range],
               hoveron='points',
               hoverinfo='all',
               mode='markers+')
]
layout = go.Layout(title='',
                   xaxis=dict(title='Pourcentage de fold au 3bet', ),
                   yaxis=dict(title='Pourcentage de raise au bouton', ))
fig = go.Figure(data=data, layout=layout)