Is someone willing to make this stat?

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

Is someone willing to make this stat?

Postby DpR33 » Sun Aug 17, 2008 10:02 pm

I am a limit player hoping to get a stat that tells me how often the SB or BB calls the flop and then c/r's the turn after calling a steal preflop. (HU only) Is anyone willing to help create this statistic for PT?
DpR33
 
Posts: 10
Joined: Mon Jan 28, 2008 6:22 pm

Re: Is someone willing to make this stat?

Postby WhiteRider » Mon Aug 18, 2008 4:37 am

This is a relatively straightforward stat, so try building it yourself.
Have a look at some existing stats like facing a steal, betting the flop, etc to see which database fields to use.
Here are a few to get you started:
holdem_hand_player_statistics.flg_blind_b and flg_blind_s
holdem_hand_player_statistics.flg_blind_def_opp
holdem_hand_summary.cnt_players_f
holdem_hand_player_statistics.cnt_f_call
holdem_hand_player_statistics.flg_t_check_raise

See the Custom Statistics and Reports FAQ for some examples.

Have a go, and if you get stuck let us know..
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Is someone willing to make this stat?

Postby DpR33 » Mon Aug 18, 2008 5:36 pm

Wow, pounding headache trying to learn what is going on with this stuff. I am literally starting with ZERO knowledge of how any of this stuff works, so hopefully I am at least in the right are code.

So I need to first filer all of the hands for the right situation. Is that something like:

if(holdem_hand_player_statistics.flg_blind_b or holdem_hand_player_statistics.flg_blind_s and holdem_hand_player_statistics.flg_blind_def_opp and holdem_hand_summary.cnt_players_f and
holdem_hand_player_statistics.cnt_f_call and holdem_hand_player_statistics.flg_t_check_raise, 1,0)

So if I write this in the expression field int he column tab it will make a column with all hands marked with a 1 that the player was in either of the blinds, defended a blind steal, called a continuation bet and then raised the turn? If so, then I need to add that only 2 players saw the flop (and somehow make sure its not a situation where the SB calls the BB three bets and the stealer folds), and that the player did not 3 bet pre flop.

So then I use a sum expression in front of that to give me the total times he did this action. That goes in teh column/expression?

Then I make another one showing summing all the times the same action occurs excluding the turn c/r. Then in the statistics tab I make just divide the former by ther latter.

Is that remotely clsoe to what I want to be trying?
DpR33
 
Posts: 10
Joined: Mon Jan 28, 2008 6:22 pm

Re: Is someone willing to make this stat?

Postby WhiteRider » Mon Aug 18, 2008 6:09 pm

You're on the right lines, yes.

You need to make a new Column to include the calculation based on the database fields.
What you've done here:
DpR33 wrote:if(holdem_hand_player_statistics.flg_blind_b or holdem_hand_player_statistics.flg_blind_s and holdem_hand_player_statistics.flg_blind_def_opp and holdem_hand_summary.cnt_players_f and
holdem_hand_player_statistics.cnt_f_call and holdem_hand_player_statistics.flg_t_check_raise, 1,0)

Is heading in the right direction, but...

1. If you are testing for a blind steal, you don't need to check that you're in the blinds, so instead of ..
holdem_hand_player_statistics.flg_blind_b or holdem_hand_player_statistics.flg_blind_s and holdem_hand_player_statistics.flg_blind_def_opp
..you could just use..
holdem_hand_player_statistics.flg_blind_def_opp
(note: I *think* I'm right in saying that - I don't think the button will count as facing a steal raise if the cutoff open-raises, since they haven't got any money invested to be stolen..
If you do need to use all 3, then you would be better with some brackets to make sure the context is correct.
(holdem_hand_player_statistics.flg_blind_b or holdem_hand_player_statistics.flg_blind_s) and holdem_hand_player_statistics.flg_blind_def_opp
)

2. You shouldn't just check..
.. AND holdem_hand_summary.cnt_players_f AND ..
You need to check for..
holdem_hand_summary.cnt_players_f = 2 (or whatever).

3. Same with..
holdem_hand_player_statistics.cnt_f_call > 0

4. Then you put your 'if' statement in a 'sum', so the Column Expression looks like this:
sum( if[ <all of the above>, 1, 0] )
If all of the above statements about the hand are true, it will count one, otherwise it will count zero - so after it goes through all your hands, it will have counted how often those criteria (filters) were met.

5. When you create this new 'Column' it doesn't actually create a column anywhere, it just creates a new calculation value as if it was a new column in the database (but it isn't actually).
You then use this new Column in your new Statistic.

Have a look at this great new walkthrough that Kraada wrote:
viewtopic.php?f=18&t=10638#p49504

6. Of course, the Statistic you build based on that new Column will only count how often it happens - if you want to know how often they check-raise the turn as a percentage of the times they check/call the flop and then check the turn, you will need to create another Column to count the opportunities. See the walkthrough above, or the others in the Custom Statistics and Reports FAQ.

Have another play with it, and let me know how you get on.
It's bedtime for me now, but if you're still struggling tomorrow I'll help you further. If you can learn how to this stat, though, you'll be able to build more for yourself.
"Teach a man to fish...", and all that.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Is someone willing to make this stat?

Postby DpR33 » Mon Aug 18, 2008 9:17 pm

WR,

Thanks for that reply, I think I might be able to make some progress. I will report back soon.
DpR33
 
Posts: 10
Joined: Mon Jan 28, 2008 6:22 pm

Re: Is someone willing to make this stat?

Postby DpR33 » Tue Aug 19, 2008 3:03 am

Ok does this look correct?

sum(if[holdem_hand_player_statistics.flg_blind_def_opp AND holdem_hand_player_statistics.cnt_p_call > 0 AND holdem_hand_summary.cnt_players_f = 2 AND holdem_hand_player_statistics.flg_f_cbet_def_opp AND NOT(holdem_hand_player_statistics.flg_f_check_raise) AND holdem_hand_summary.cnt_players_t = 2 AND holdem_hand_player_statistics.flg_t_check_raise, 1, 0])

I use the above in the expression field on column tab and can call it anything i like (1).

Then make another that reads:

sum(if[holdem_hand_player_statistics.flg_blind_def_opp AND holdem_hand_player_statistics.cnt_p_call > 0 AND holdem_hand_summary.cnt_players_f = 2 AND holdem_hand_player_statistics.flg_f_cbet_def_opp AND NOT(holdem_hand_player_statistics.flg_f_check_raise) AND holdem_hand_summary.cnt_players_t = 2, 1, 0])

and call that (2).

Then in the statistics tab my value expression can jsut read (1)/(2) right?

I am thinking this is on the right track, but I am not sure I understand the holdem_hand_player_statistics.cnt_p_call>0 command. Does this look at each hand and return a true/1 any time the player has called at least once? Meaning if they call twice it returns true as well? I am concerned that some unwanted situations would be included such as when steal is attempted against players BB, he 3 bets, then calls a cap. Or steal attemps, SB three bets, player calls in BB, stealer caps, SB fold and BB calls. Basically I am not sure that I have ensured that only 2 bets went in preflop.

Should i be putting in some NOT raise preflop commands? or am I misunderstanding the output of this cnt_p_call stat?
DpR33
 
Posts: 10
Joined: Mon Jan 28, 2008 6:22 pm

Re: Is someone willing to make this stat?

Postby WhiteRider » Tue Aug 19, 2008 4:57 am

Yes, that looks pretty good!

DpR33 wrote:Then in the statistics tab my value expression can jsut read (1)/(2) right?

To get a percentage, you need to enter "100 * (1)/(2)", yes.

I am thinking this is on the right track, but I am not sure I understand the holdem_hand_player_statistics.cnt_p_call>0 command. Does this look at each hand and return a true/1 any time the player has called at least once? Meaning if they call twice it returns true as well?

Exactly right, yes.
I am concerned that some unwanted situations would be included such as when steal is attempted against players BB, he 3 bets, then calls a cap. Or steal attemps, SB three bets, player calls in BB, stealer caps, SB fold and BB calls. Basically I am not sure that I have ensured that only 2 bets went in preflop.
Should i be putting in some NOT raise preflop commands? or am I misunderstanding the output of this cnt_p_call stat?

Yes, this is the sort of thing you need to be careful about.
To check for a re-steal, you can check holdem_hand_player_statistics.cnt_p_raise > 0 (or rather, check that holdem_hand_player_statistics.cnt_p_raise=0).
If the SB plays (calls or raises) when there is a steal raise, then the BB isn't facing a steal, so holdem_hand_player_statistics.flg_blind_def_opp will be false.

Good work!
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Is someone willing to make this stat?

Postby DpR33 » Tue Aug 19, 2008 9:43 pm

WR, Thanks a bunch for help guiding me through this process. I think I am armed enough to be able to make some more stats in the future.

I added in no raise pre flop and I think the statistic is working. Is there some way I can identify the hands that the statistic is tagging to make sure they fit in with what I am trying to do?
DpR33
 
Posts: 10
Joined: Mon Jan 28, 2008 6:22 pm

Re: Is someone willing to make this stat?

Postby WhiteRider » Wed Aug 20, 2008 8:15 am

Well done! Glad I've been able to help you understand it.

What I always do when testing is create basically the same stat in the 'holdem cash hands' section.
I use the Hand tab to test and you add the stat you already created to the top report (Known Starting Hands Summary), and then you can add a 'holdem cache hands' stat to the bottom report (Known Starting Hands Detail) to identify which hands fit the criteria.

Select the Column for the stat you already created and copy the expression.
Switch to 'holdem cash hands' section and create a new Column and paste the expression in, but edit out the "sum" and "if" parts so that you just end up with the boolean (true/false) test. You now have a Column which will have a value of true or false for each individual hand. You can create a stat for the opportunities and the instances, just as you did in 'holdem cash player statistics'.
Create a stat for each of your columns this time, and just include the value of one column, and in the format expression enter:
format_boolean( <name_of_column>, 'check' )
When you add these stats to the known hands detail report you will get a checkbox which will be checked for true and unchecked for false, then you can quickly identify which hands your stat is true for, and which are an 'opportunity'.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 0 guests