Page 1 of 2

need help with custom stat - % folded after flop

PostPosted: Thu Nov 11, 2010 1:48 am
by squeebo
My first simple attempt at a statistic for % of time player folds on any street postflop. In the HUD it appears to work sometimes, but for many players it's 0, when I can see from the popup stat table that it shouldn't be. I copied some of the formatting from other examples, so I may have well screwed up. Any ideas?


section: Holdem cash player statistics

value expression for column cnt_fold_postflop:
Code: Select all
sum(if[
holdem_hand_player_statistics.flg_f_saw
AND (holdem_hand_player_statistics.flg_f_fold
OR holdem_hand_player_statistics.flg_t_fold
OR holdem_hand_player_statistics.flg_r_fold), 1, 0
])


value expression for statistic Fold Postflop %:
Code: Select all
(cnt_fold_postflop / cnt_f_saw) * 100


format expression:
Code: Select all
(cnt_fold_postflop / cnt_f_saw) * 100

Re: need help with custom stat - % folded after flop

PostPosted: Thu Nov 11, 2010 4:30 am
by shahrad
I guess format expression has to be: /%.2f

Re: need help with custom stat - % folded after flop

PostPosted: Thu Nov 11, 2010 5:45 am
by WhiteRider
That looks like it should be OK, with one possible minor issue:
cnt_f_saw counts all times that you saw the flop including those times when the hand was checked down, meaning that you didn't have an opportunity to fold.

If you want to count only opportunities default post flop you could do it like this:

cnt_postflop_fold_opp =
sum( if[ (holdem_hand_player_detail.amt_f_bet_facing + holdem_hand_player_detail.amt_f_raise_facing + holdem_hand_player_detail.amt_t_bet_facing + holdem_hand_player_detail.amt_t_raise_facing + holdem_hand_player_detail.amt_r_bet_facing + holdem_hand_player_detail.amt_r_raise_facing) > 0), 1, 0 ] )

..which checks for facing any bet or raise post flop.

Re: need help with custom stat - % folded after flop

PostPosted: Thu Nov 11, 2010 1:06 pm
by squeebo
Ok, I'll try that. But what could account for the stat being 0 for many players for whom the popup stats show they folded several times on the flop?

Re: need help with custom stat - % folded after flop

PostPosted: Thu Nov 11, 2010 1:49 pm
by kraada
I'm not sure but you could simplify the expression some:

sum(if[ holdem_hand_player_statistics.flg_f_saw AND holdem_hand_player_statistics.enum_folded != 'N', 1, 0])

will also work - they saw the flop (so we know they didn't fold preflop) and they didn't not fold ('N' is no fold), so they must have folded somewhere postflop.

Re: need help with custom stat - % folded after flop

PostPosted: Thu Nov 11, 2010 2:30 pm
by squeebo
So I've isolated the problem somewhat. When I run Update Cache in housekeeping, the stat is are updated for all players, but it stops counting from that point for all existing and new players added to the database. So for example, the stat for all new players added since housekeeping is 0. For existing players, the count is not updated. If a player before housekeeping folded 5 out of 10 times post flop, the stat is 50% (5/10). If he folds 5 out of the next 5 times post flop, the stat is 30% (5/15 instead of 10/15) and as such continues to go down regardless of how often he folds.

What would cause a stat to not be updated like this except when I run housekeeping? I've verified it by checking the stats of about 9 players who existed prior to housekeeping, and all the ones that were not in the database prior to housekeeping continue to have a stat of 0%.

I've changed the statistic's format expression to /%.2f with no apparent result.

I also just ran Update Cache again, which finished in a second this time instead of 30 minutes, and now the existing players prior to that still don't have updated stats. So I'm confused.

Re: need help with custom stat - % folded after flop

PostPosted: Thu Nov 11, 2010 3:34 pm
by kraada
What version of PT3 are you currently using?

Re: need help with custom stat - % folded after flop

PostPosted: Thu Nov 11, 2010 3:40 pm
by squeebo
v 3.06.2

Re: need help with custom stat - % folded after flop

PostPosted: Thu Nov 11, 2010 4:44 pm
by kraada
Try upgrading to our most recent beta and see if that helps.

Re: need help with custom stat - % folded after flop

PostPosted: Thu Nov 11, 2010 5:35 pm
by squeebo
Ok, the latest beta looks to have fixed the bug! The stat is updating now.