Building my first custom stat.

Discuss how to create custom stats, reports and HUD profiles and share your creations.

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

Building my first custom stat.

Postby aramalho » Tue Jan 29, 2013 11:23 pm

Hi there, I've been reading a lot of topics about custom stats on PT4, I must confess for a starter is not easy, specially because i came from Holdem manager 1. So i hope i can count with your help.

Here are the stats i'm trying to build:

1 Sb raises first in 0 - 8bb's (effective stack between Sb and BB)

2 Sb raises first in 7 - 13 bb's (effective stack between Sb and BB)
...
3 Sb raises first in 30+ bb's

4 Sb Fold vs BB 3bet 7 - 13 bb's effective stack between Sb and BB

5 Sb fold vs Bb 3bet 12 - 18 effective stack between Sb and BB

6 Button raises first in Sb raises first in 0 - 8bb's ( is it possible effective stack)?


....
Thank you in advance :)
aramalho
 
Posts: 85
Joined: Tue Jul 10, 2012 10:21 am

Re: Building my first custom stat.

Postby kraada » Wed Jan 30, 2013 11:28 am

In general you don't need to make the same stat but just for a different position - in the HUD you can add your generic stat and change the Position property to see it just from the position you pick (e.g. SB or BB or BTN) and in a report you can just put it in a report that groups by Position.

So that cuts down on some of the work :)

Let's focus on raising first in with an effective stack of 0 to 8 BBs.

In the Configure -> Statistics window, look at the Raise First In stat. On the Definition page you can see its Value Expression - this is the values used to calculate the stat. So you can see that is (cnt_p_raise_first_in / cnt_p_open_opp ) * 100

cnt_p_raise_first_in and cnt_p_open_opp are columns. Change to the Columns page and you can look at their definitions. Columns are where PT4 gets data from the database directly, so when you build new stats you often (though not always) want new columns. In this case you definitely do - because you need to get new data that is narrower than existing data (if you just wanted to recombine other columns that already exist you wouldn't need new data).

In this case we want to add a condition to only look at hands with an effective stack of less than or equal to 8 BBs. That condition would be:
cash_hand_player_statistics.amt_p_effective_stack <= cash_limit.amt_bb * 8

So you'll want to duplicate these existing columns and add that in; here's how you would do it for cnt_p_raise_first_in:

sum(if[cash_hand_player_statistics.flg_p_first_raise AND cash_hand_player_statistics.flg_p_open_opp AND cash_hand_player_statistics.amt_p_effective_stack <= cash_limit.amt_bb * 8, 1, 0])

Obviously you need to name it something else to save it. Make a similar change to cnt_p_open_opp. Once both of these columns are saved, you can build your new stat out of these two columns; you can duplicate Raise First In and make changes (new name, changed title/description, different columns) to make it a bit easier since it'll give you a place to start.

Then from there you can change things as you need . . . also it's useful to know you can use BETWEEN to test for stuff like 7 to 13 bbs. In that case it'd be:
cash_hand_player_statistics.amt_p_effective_stack BETWEEN cash_limit.amt_bb * 7 and cash_limit.amt_bb * 13

Good luck!
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Building my first custom stat.

Postby aramalho » Wed Jan 30, 2013 3:07 pm

Could you re-write the Expression, since this is for tournaments, it's not acepting :(

Thanks
aramalho
 
Posts: 85
Joined: Tue Jul 10, 2012 10:21 am

Re: Building my first custom stat.

Postby aramalho » Wed Jan 30, 2013 3:52 pm

If you have time after re-writting me the quote, could you also clarify me on this?

kraada wrote:In general you don't need to make the same stat but just for a different position - in the HUD you can add your generic stat and change the Position property to see it just from the position you pick (e.g. SB or BB or BTN) and in a report you can just put it in a report that groups by Position.

So that cuts down on some of the work :)


When you're BB and SB it's easy to come up with effective stack ( since it would consider the player with less chips ), let's say I'd use this same stat for button or Cut off, how would it be calculated?


Thank you!!
aramalho
 
Posts: 85
Joined: Tue Jul 10, 2012 10:21 am

Re: Building my first custom stat.

Postby kraada » Wed Jan 30, 2013 4:18 pm

For tournaments it's:

sum(if[tourney_hand_player_statistics.flg_p_first_raise AND tourney_hand_player_statistics.flg_p_open_opp AND tourney_hand_player_statistics.amt_p_effective_stack <= tourney_blinds.amt_bb * 8, 1, 0])

The effective stack is the amount of money you could lose to a single player on your first action. So if everyone folds to you it's the larger of your stack or the largest opponent stack. If you're in the BB and get a walk you can't lose anything so your effective stack is 0.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Building my first custom stat.

Postby aramalho » Wed Jan 30, 2013 5:52 pm

1st Question:
Right now Code is working, but results appear totally misleading, since all my database would raise 100% over huge sample on 0 - 8 bb's effective.

Basically what I've done so far.
Columns;
cnt_p_raise_first_in_0_8_effec :

sum(if[tourney_hand_player_statistics.flg_p_first_raise AND tourney_hand_player_statistics.flg_p_open_opp AND tourney_hand_player_statistics.amt_p_effective_stack <= tourney_blinds.amt_bb * 8, 1, 0])

cnt_p_open_opp_0_8
sum(if[tourney_hand_player_statistics.flg_p_first_raise AND tourney_hand_player_statistics.flg_p_open_opp AND tourney_hand_player_statistics.amt_p_effective_stack <= tourney_blinds.amt_bb * 8, 1, 0])

(cnt_p_raise_first_in_0_8_effec / cnt_p_open_opp_0_8 ) * 100


Shouldn't it work properly?

2nd question Question:

As said in the first post, I'm also building a ''Sb Fold vs BB 3bet 7 - 13 bb's effective stack between Sb and BB'' I believe that you assumed that with example you gave I'd be already prepared to make it my own, not yet :P So I'd appretiate if you could write it, so i can understand the thought process and learn it..
Thank you in advance!
aramalho
 
Posts: 85
Joined: Tue Jul 10, 2012 10:21 am

Re: Building my first custom stat.

Postby PeteX » Wed Jan 30, 2013 6:03 pm

This is wrong:
cnt_p_open_opp_0_8
sum(if[tourney_hand_player_statistics.flg_p_first_raise AND tourney_hand_player_statistics.flg_p_open_opp AND tourney_hand_player_statistics.amt_p_effective_stack <= tourney_blinds.amt_bb * 8, 1, 0])


Remove this bit: "tourney_hand_player_statistics.flg_p_first_raise AND"

See, your expressions are now 1:1 same -> The calculation is always X/X = 1 or 100%. You need to remove the raise-condition from the bottom expression so that it covers really all possible open opportunities with <= 8bb stack, and not just those where the player raised first. That condition you only want to have on the top expression.
PeteX
 
Posts: 194
Joined: Sat Apr 05, 2008 9:12 am

Re: Building my first custom stat.

Postby aramalho » Wed Jan 30, 2013 7:36 pm

PeteX wrote:This is wrong:
cnt_p_open_opp_0_8
sum(if[tourney_hand_player_statistics.flg_p_first_raise AND tourney_hand_player_statistics.flg_p_open_opp AND tourney_hand_player_statistics.amt_p_effective_stack <= tourney_blinds.amt_bb * 8, 1, 0])


Remove this bit: "tourney_hand_player_statistics.flg_p_first_raise AND"

See, your expressions are now 1:1 same -> The calculation is always X/X = 1 or 100%. You need to remove the raise-condition from the bottom expression so that it covers really all possible open opportunities with <= 8bb stack, and not just those where the player raised first. That condition you only want to have on the top expression.


Yes, Makes total sense and it's working properly now :)
aramalho
 
Posts: 85
Joined: Tue Jul 10, 2012 10:21 am


Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 17 guests

cron
highfalutin