Tutorial: Creating C-bet Success Statistic

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

Re: Tutorial: Creating C-bet Success Statistic

Postby dendron » Wed Aug 20, 2008 1:32 am

I played around with the cbet size and wound up getting a 1 or 0 as a result, played with it some more then somehow got true or false as results lol. No big deal, I'll keep trying. I probably missed a parentheses or something simple.

My real question here is how would I make a stat that tells me how much I won when my cbets were successful? And the BB/100? I can get these numbers through the filters easily enough but I'd like to see an example of how to write the query so I'd be able to apply it to whatever other stats I create in the future. I'm really not sure how to get a money stat when certain conditions are applied, the only column I see with money involved is the amt_won column so I don't have much to work with as far as my mix and match SQL skills go.
dendron
 
Posts: 31
Joined: Fri Jan 25, 2008 10:33 pm

Re: Tutorial: Creating C-bet Success Statistic

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

If you add in a check for c-bet size you will still get a true or false - what you would be counting is how often your c-bet works when it's less than half the pot, or more than 3/4 pot, or whatever.

If you want to build a stat to show your average c-bet size, instead of summing 1 or 0, you would have to sum 'holdem_hand_player_detail.amt_f_bet_made' or 0, and then in the Statistic divide that by the number of c-bets.
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Tutorial: Creating C-bet Success Statistic

Postby kraada » Wed Aug 20, 2008 9:35 am

dendron wrote:My real question here is how would I make a stat that tells me how much I won when my cbets were successful? And the BB/100? I can get these numbers through the filters easily enough but I'd like to see an example of how to write the query so I'd be able to apply it to whatever other stats I create in the future. I'm really not sure how to get a money stat when certain conditions are applied, the only column I see with money involved is the amt_won column so I don't have much to work with as far as my mix and match SQL skills go.


Go to the cnt_f_cbet_success column, click on Dup to duplicate it, and call the new one val_amt_won_f_cbet_success or some such.

Go to the value expression, and instead of the '1' in the 'then' area of the if[] statement, put in holdem_hand_player_statistics.amt_won.

Duplicate and edit a statistic to display the results here (you probably want to look at how the Amount Won stat is set up using format_money() so that your results here will show a dollar sign and green for positive, red for negative), but otherwise you'll be all set.

Instead of adding '1' when the c-bet success if[] statement goes through, you'll now add the amount you won from that hand. So the total sum of that stat will be the amount of money you won when c-betting successfully.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Tutorial: Creating C-bet Success Statistic

Postby pkrlvr » Wed Aug 20, 2008 3:41 pm

kraada wrote:Please note this doesn't take into account what you had. However, if your c-bet success rate was 50.1% you are showing automatic profit whenever you raise and c-bet even if you c-bet pot every single time regardless of your holdings.


I don't think this is quite true, if we bet pot we need to be successful around 60% of the time. Assuming we raise 3.5bb preflop and only the BB calls, pot is 7.5bb .

7.5 * .50 = 3.25(50% of the time we win the 7.5)
11.0 * .50 = 5.50(50% of the time we lose our PSB + our PFR)

so if our cbet fails 50% of the time we are losing 2.25bb every time we do it unless I'm missing something.
pkrlvr
 
Posts: 18
Joined: Tue Aug 05, 2008 7:52 pm

Re: Tutorial: Creating C-bet Success Statistic

Postby kraada » Wed Aug 20, 2008 4:01 pm

I'm looking at just the validity of the c-bet itself.

If the pot is 1, and you c-bet 1, you need to win > 50% to make that bet +ev.

When you start incorporating the raise size as well you need to also take into account the times when your PFR just folds everybody out (among other factor).

Let me put it this way:

Given that you've already raised and had a call preflop, you need a c-bet the size of the pot to take it down 50% or more in order to break even on that bet alone (ie- ignoring the preflop raise).

Does that make more sense?
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Tutorial: Creating C-bet Success Statistic

Postby dendron » Wed Aug 20, 2008 4:41 pm

WhiteRider wrote:If you add in a check for c-bet size you will still get a true or false - what you would be counting is how often your c-bet works when it's less than half the pot, or more than 3/4 pot, or whatever.

If you want to build a stat to show your average c-bet size, instead of summing 1 or 0, you would have to sum 'holdem_hand_player_detail.amt_f_bet_made' or 0, and then in the Statistic divide that by the number of c-bets.


Oh yeah, that makes sense. Somehow forgot about the whole if, then, else part. Kind of important lol. I'll give it a shot, hopefully I can post something that works. Thanks
dendron
 
Posts: 31
Joined: Fri Jan 25, 2008 10:33 pm

Re: Tutorial: Creating C-bet Success Statistic

Postby dendron » Wed Aug 20, 2008 4:54 pm

pkrlvr wrote:
kraada wrote:Please note this doesn't take into account what you had. However, if your c-bet success rate was 50.1% you are showing automatic profit whenever you raise and c-bet even if you c-bet pot every single time regardless of your holdings.


I don't think this is quite true, if we bet pot we need to be successful around 60% of the time. Assuming we raise 3.5bb preflop and only the BB calls, pot is 7.5bb .

7.5 * .50 = 3.25(50% of the time we win the 7.5)
11.0 * .50 = 5.50(50% of the time we lose our PSB + our PFR)

so if our cbet fails 50% of the time we are losing 2.25bb every time we do it unless I'm missing something.


Like Kraada said, this stat only looks at what happened during the cbet. Everything that happened before or after would be a whole different situation and you'd be using a different stat, ie. steal success % or something. Money you put in the pot on previous streets is no longer yours, it's the pot's money now and shouldn't be factored in when determining your current pot equity.
dendron
 
Posts: 31
Joined: Fri Jan 25, 2008 10:33 pm

Re: Tutorial: Creating C-bet Success Statistic

Postby dendron » Wed Aug 20, 2008 5:26 pm

kraada wrote:
dendron wrote:My real question here is how would I make a stat that tells me how much I won when my cbets were successful? And the BB/100? I can get these numbers through the filters easily enough but I'd like to see an example of how to write the query so I'd be able to apply it to whatever other stats I create in the future. I'm really not sure how to get a money stat when certain conditions are applied, the only column I see with money involved is the amt_won column so I don't have much to work with as far as my mix and match SQL skills go.


Go to the cnt_f_cbet_success column, click on Dup to duplicate it, and call the new one val_amt_won_f_cbet_success or some such.

Go to the value expression, and instead of the '1' in the 'then' area of the if[] statement, put in holdem_hand_player_statistics.amt_won.

Duplicate and edit a statistic to display the results here (you probably want to look at how the Amount Won stat is set up using format_money() so that your results here will show a dollar sign and green for positive, red for negative), but otherwise you'll be all set.

Instead of adding '1' when the c-bet success if[] statement goes through, you'll now add the amount you won from that hand. So the total sum of that stat will be the amount of money you won when c-betting successfully.


Thanks a lot! It's starting to make sense now and I think I got it to work.

Column name:
amt_won_cnt_f_cbet_success

Expression:
sum(if[holdem_hand_player_statistics.flg_f_cbet
AND NOT(holdem_hand_player_statistics.flg_t_saw)
AND NOT(holdem_hand_player_statistics.flg_f_face_raise),
holdem_hand_player_statistics.amt_won, 0])


Stat name:
Amount Won Successful Cbet

Stat Expression: (duplicate the amt_won stat then enter the changes)
amt_won_cnt_f_cbet_success

Format Expression:
format_money(amt_won_cnt_f_cbet_success, true)
dendron
 
Posts: 31
Joined: Fri Jan 25, 2008 10:33 pm

Re: Tutorial: Creating C-bet Success Statistic

Postby BoFo » Sun Sep 07, 2008 10:12 pm

Hi!

I'm sorry, but I can't make it work.

I have done it all, including putting "/%.2f" in the format summary expression. All the validations say: fine.

Now how do I get to use this stat? It does not appear in my "Configure hud / stats".

From the "configure stats" I have tried to put it into eg the "general / player stats", but get an "unable to execute" followed by three lines of red text that leave me no less confused.

I tried to make it a report, but was told: "FATAL ERROR: aggregates not allowed in GROUP BY clause". And a lot more in red letters.



Really I did not do this to make a cbet_success stat. I just tried to learn, in order to make what I really want: A stat showing what a player does to different hole cards, eg high pairs.

I figure the expression should be in the neighbourhood of: "sum((cnt_p_raise if[( id_holecard = TT OR JJ OR QQ OR KK OR AA OR AK), 1 , 0 ]) / (id_holecard = TT OR JJ OR QQ OR KK OR AA OR AK) * 100)" where TT etc means premium holdings. This is of course not valid.

Programming (+ maths and english) is certainly a long way from my everyday life, but I hope somebody will take time off to help me with my silly problems.

Yours, Bo.
BoFo
 
Posts: 31
Joined: Thu Aug 14, 2008 10:46 am

Re: Tutorial: Creating C-bet Success Statistic

Postby WhiteRider » Mon Sep 08, 2008 10:08 am

BoFo wrote:I have done it all, including putting "/%.2f" in the format summary expression. All the validations say: fine.
Now how do I get to use this stat? It does not appear in my "Configure hud / stats".

From the "configure stats" I have tried to put it into eg the "general / player stats", but get an "unable to execute" followed by three lines of red text that leave me no less confused.

I tried to make it a report, but was told: "FATAL ERROR: aggregates not allowed in GROUP BY clause". And a lot more in red letters.

Firstly, you did create it in the 'holdem cash player statistics' section, didn't you?
Check your Columns, and make sure that the 'group by' option isn't checked for any of them.
After you save your stat, you will need to restart the HUD for the new stat to work.

Really I did not do this to make a cbet_success stat. I just tried to learn, in order to make what I really want: A stat showing what a player does to different hole cards, eg high pairs.

I figure the expression should be in the neighbourhood of: "sum((cnt_p_raise if[( id_holecard = TT OR JJ OR QQ OR KK OR AA OR AK), 1 , 0 ]) / (id_holecard = TT OR JJ OR QQ OR KK OR AA OR AK) * 100)" where TT etc means premium holdings. This is of course not valid.

You won't be able to check:
id_holecard = TT OR JJ OR ...
Two things:
1. You would need to do
id_holecard = TT OR id_holecard = JJ OR ...
2. The value of id_holecard isn't TT, etc. It is a numeric value which references the table lookup_hole_cards.
Have a look at the "Hand" stat in the 'holdem cash hand' section to see how this is used. Then if you go to a new Stat and click the 'insert' link and choose the Functions tab, you can see the 'Lookup From Id' function, and the options are listed.
The best way to do it, though, is probably to experiment to find out what the values of id_holecard are for the required pairs.
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

PreviousNext

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

Who is online

Users browsing this forum: Google [Bot] and 6 guests

cron
highfalutin