by kraada » Sun Jun 21, 2009 8:58 pm
The first stat is there, at least you can display it for the HUD in Beta 28.1 - use attempt to steal and set it for Blinds. The only time you can attempt to steal is when folded to in the small blind.
The percent of the time the BB raises when only the SB has put money in and he completed is buildable, it's just a bit tricky.
You'd need these two columns:
cnt_p_bb_raise_facing_sb_limp: sum(if[holdem_hand_player_statistics.position = 8 and holdem_hand_player_detail.val_p_raise_made_pct > 0 and (100 / holdem_hand_player_detail.val_p_raise_made_pct) * holdem_hand_player_detail.amt_p_raise_made = 2 * holdem_hand_player_detail.amt_blind, 1, 0])
cnt_p_bb_open_opp_facing_sb_limp: sum(if[(holdem_hand_player_statistics.position = 8 and holdem_hand_player_detail.val_p_raise_made_pct > 0 and (100 / holdem_hand_player_detail.val_p_raise_made_pct) * holdem_hand_player_detail.amt_p_raise_made = 2 * holdem_hand_player_detail.amt_blind)) or (holdem_hand_player_statistics.position = 8 and lookup_action_p.action LIKE 'X' and holdem_hand_player_statistics.flg_f_has_position), 1, 0])
Let me take a moment to explain this one for you as it is in fact tricky.
First, the case where you actually raise in the bb facing a sb limp. position = 8 means you're in the BB. That val_p_raise_made_pct > 0 means you raised preflop. All well and good. Now let's look at the other equality:
(100 / holdem_hand_player_detail.val_p_raise_made_pct) * holdem_hand_player_detail.amt_p_raise_made = 2 * holdem_hand_player_detail.amt_blind
The right side of the equality is pretty simple, twice the big blind (since you're in the BB and you put in one big blind, amt_blind is always 1bb). So what is equal to twice the big blind? Recall that val_p_raise_made_pct is the percentage of the pot that you raised preflop. You could also express this as:
(amount of raise / amount of pot) * 100 (if the pot is 2 and you raise 1, you raised 1/2 * 100 or 50% of the pot). So we have 100 over val_p_raise_made_pct, which then gives:
1 / (amount of raise / amount of pot), or (amount of pot / amount of raise). We multiply by amount of raise, which causes it to cancel. All that's left is the amount of the pot.
So we are saying the pot is equal to two big blinds. The only time the pot can be equal to two big blinds is when the SB completes and it's to you in the BB. In all other cases if someone else puts money in the pot is bigger.
So you can see this picks out the times when the SB has limped and you raised.
Moving on to the opportunity column, we have two cases: (a) where you were in the BB, had the chance to raise the SB limper and raised, or (b) you had the chance to raise the SB limper, and checked. We already have (a) from the piece for seeing when you did actually in fact raise. So we have that, OR the following setup: (holdem_hand_player_statistics.position = 8 and lookup_action_p.action LIKE 'X' and holdem_hand_player_statistics.flg_f_has_position)
In this case again we are in the SB, our preflop action is just checking. That means we could not have been facing a preflop raise, so all people in the pot must have limped. We also add that we must have position on the flop (note: if we check in the BB there will always be a flop), but the only time we can have position on the flop and there have been no preflop raise is if the SB limped.
And that covers all cases.
(Then you just need to build the statistic using these two columns.)