Custom Stat support

Questions and discussion about PokerTracker 4 for Windows

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

Custom Stat support

Postby Parket » Wed Jan 18, 2012 7:14 am

Is the Custom Stats support fully implemented yet ?
I wanted to import my custom PT3 stats, but the first one I'm trying is already failing : "Stats from the section 'Holdem Tournament Tournament' cannot be imported into this version of PokerTracker". Is this a beta/temporary thing only, or do I have to follow a different way to get my stat in PT4 ? I also tried to manually enter the stat in PT4, but the validation fails, stating that the SQL is invalid.
Parket
 
Posts: 367
Joined: Mon Mar 24, 2008 1:03 pm

Re: Custom Stat support

Postby kraada » Wed Jan 18, 2012 10:40 am

There is no Tournament section in PT4 - there is only Player and Hand. What stat are you trying to bring over and how is it defined in PT3?
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Custom Stat support

Postby Parket » Wed Jan 18, 2012 11:08 am

I wanted to implement my custom Cashout stat (it's also in the public stats repository here).
Basically it's a function of the buy-in, number of players, and tournament type. I want to add that as an extra summable column in the View Stats - By Tournament table.
Parket
 
Posts: 367
Joined: Mon Mar 24, 2008 1:03 pm

Re: Custom Stat support

Postby kraada » Wed Jan 18, 2012 1:39 pm

Could you please remind me how the column is defined? Bringing over Tournament stats into the new format is tricky business but I'd like to help you get this one in.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Custom Stat support

Postby Parket » Wed Jan 18, 2012 2:28 pm

Sure, here's what I had in PT3 :
a) everything is done in section: Holdem Tournament Tournament.
b) custom column defined: amt_cashout_base. Expression: "4*log(1+if[position('D' in tourney_table_type.val_flags)>0 OR position('F' in tourney_table_type.val_flags)>0, 2, cnt_players])*amt_buyin_ttl/100". Summary type = Sum.
c) custom column defined: amt_cashout. Expression: "if[tourney_table_type.val_speed='N', amt_cashout_base, if[tourney_table_type.val_speed='T', amt_cashout_base/1.5, amt_cashout_base/2] ]". Summary type = Sum.
d) custom Statistic defined: Cashout. Value Expression: "amt_cashout". Format: "format_money(amt_cashout, false)".

(b) basically takes the number of players in the tournament and applies some logarithmic magic to take that as the percentage of the buy-in. If tournament type is Double-or-Nothing ("D") or Fifty-50 ("F") this is considered similar to 2 players.
(c) then takes this number and divides it by 1.5 or 2 when the tournament speed is Turbo or Super-Turbo respectively.
Parket
 
Posts: 367
Joined: Mon Mar 24, 2008 1:03 pm

Re: Custom Stat support

Postby kraada » Wed Jan 18, 2012 7:18 pm

A few things:

(1) You can't use the position() function in players stats as it automatically gets converted into the position table in the field - you can't use strpos() either as the ',' that is required triggers the "then" portion of the if[] statement. The way around this is to use a subquery to get the id_tourney_type values we need and use 'in' for comparison.

(2) It looks like the validator gets very confused at trying to do the entire thing inside the column expression - but since the other values we need are just multiplication and division we can do that in the stat itself.

The reworked expression is:

log( 1 + if[id_tourney_type in (SELECT id_tourney_type from tourney_table_type where tourney_table_type.val_flags SIMILAR TO '%(D|F)%'), 2, cnt_players])

This gets you most of amt_cashout_base - you just need to multiply it by amt_buyin_ttl / 25 (simplifying the 4 and 100).

You can then define amt_cashout as:

if[tourney_table_type.val_speed='N', amt_cashout_base, if[tourney_table_type.val_speed='T', amt_cashout_base/1.5, amt_cashout_base/2] ]

And do your final multiplying by amt_buyin_ttl / 25 at the end in the stat (since multiplying before or after you divide will give you the same result.

These should work properly then - but you'll want to use format_currency() in PT4 to go with the PT4 scheme and you'll want to put it in the tourney_currency (see how the GC stats work) as no conversion is being done here.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Custom Stat support

Postby Parket » Wed Jan 18, 2012 7:43 pm

Thanks a lot for the help.

I'm not quite there though. For some weird reason, as soon as I add 'amt_buyin_ttl' to my expressions, the SQL is no more valid.
E.g. even something simple as 'amt_cashout * amt_buyin_ttl' is invalid SQL, but '4 * amt_buyin_ttl' is accepted, as is '4 * amt_cashout'.
Parket
 
Posts: 367
Joined: Mon Mar 24, 2008 1:03 pm

Re: Custom Stat support

Postby Parket » Thu Jan 19, 2012 7:53 am

BTW, something to check by the devs as well : there is an inconsistency or wrong documentation of some of the Columns.

amt_buyin = Amount paid to buy-in.
amt_buyin_curr_conv = Amount paid to buy-in converted to the user selected currency.

But then I see this:

amt_buyin_ttl = Total entry fee into the tournament in the Preferred currency set in PokerTracker.
amt_buyin_ttl_curr_conv = Total entry fee into the tournament.

By the way the latter 2 are calculated, I think it's the Description that is wrong and amt_buyin_ttl is the total buy-in in the original currency, and amt_buyin_ttl_curr_conv is that total buyin converted into the user selected currency.
Parket
 
Posts: 367
Joined: Mon Mar 24, 2008 1:03 pm

Re: Custom Stat support

Postby Parket » Thu Jan 19, 2012 8:11 am

Parket wrote:I'm not quite there though. For some weird reason, as soon as I add 'amt_buyin_ttl' to my expressions, the SQL is no more valid.
E.g. even something simple as 'amt_cashout * amt_buyin_ttl' is invalid SQL, but '4 * amt_buyin_ttl' is accepted, as is '4 * amt_cashout'.


The good news is that I figured out how to do this. My mistake was that I wanted to do those calculations also in Columns. Instead I had to create a Variable instead, or even simpler: just do the calculation straight in Stats in the custom statistic.

The bad news is that whatever I define in Custom Statistics, disappears as soon as I leave the Statistics GUI. When I re-enter Custom Statistics, I can't find any of my custom stats or columns.
Parket
 
Posts: 367
Joined: Mon Mar 24, 2008 1:03 pm

Re: Custom Stat support

Postby kraada » Thu Jan 19, 2012 10:26 am

Ok that is bad - I presume you are saving your stat and columns and clicking Apply (not Cancel) to close the Configure Statistics window?

Do you have any trouble saving other things (e.g. a HUD layout)?
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Next

Return to PokerTracker 4

Who is online

Users browsing this forum: No registered users and 76 guests

cron