PDA

View Full Version : Guide for building custom stats?



goofyballer
08-02-2009, 04:12 AM
Is there any kind of guide to learning the syntax used to make custom stats? All I see in the stickies are the definitions of existing stats, which is somewhat helpful but I tend to learn better from having things explained rather than looking at examples.

fozzy71
08-02-2009, 09:11 AM
Sticky: Formulas for every HM Stat! (http://www.holdemmanager.net/forum/showthread.php?t=3595)

That should get you started.

If you have any particular questions, I can ask the developer to respond. I am obviously clueless when it comes to this. ;)

goofyballer
08-02-2009, 05:35 PM
Sticky: Formulas for every HM Stat! (http://www.holdemmanager.net/forum/showthread.php?t=3595)

Yeah, those are the definitions I was referring to in the OP.

goofyballer
08-08-2009, 07:37 PM
Bump!

00Blitz
08-18-2009, 10:07 AM
I'll hook in here;

I'll take the following customstat as example

<Stat GroupName="Default" ColumnName="Rakeback" ValueExpressions="Sum(PH.RakeAmount)/100.0*0.27 as RakeBackAmount" Evaluate="RakeBackAmount" ColumnHeader="Rakeback" ColumnFormat="$0.00" ColumnWidth="*" Tooltip="Rakeback based on 27%" />
note: quote and code tags only showed an empty box for the above code.

Where can you lookup the list that has the names like PH.RakeAmount (and other examples are; GT.BigBlind, etc)?
I can partly answer this by looking at the database tables but could use some more feedback. I found some stat prefixes in an other post


PH PlayerHandsCash(or Tourney)KeyColumns
PHMISC PlayerHandsCash(or Tourney)Miss
GT GameType
PKH PokerHands
FLOP PlayerHandsFlop
TURN PlayerHandsTurn
RIVER PlayerHandsRiver
TABLES Tables
HOLECARDS HoleCards
EV AllInSituations

Are these all? Also although this is somewhat useful I'm going to assume it's incomplete because:

A known stat is GT.BigBlind, if I look in the database at the table "gametypes" I do see a stat named "bigblind" but I assume it's case-sensitive. So is it UpperCamelCase for naming or something else?

Back to the code sample. Is there a way to refer to the value of this newly created stat (maybe by referring to the columnheader or something similar?) I don't want to copy the whole formula to a new stat to continue working with it as that can get quite big and messy :E

Thank you

fozzy71
08-18-2009, 11:04 AM
Bump!

Sorry, I never saw this. I am going to (finally) forward this to Roy for a reply.

00Blitz
08-18-2009, 12:36 PM
Sorry, I never saw this. I am going to (finally) forward this to Roy for a reply.
Good to know. I'll add another question while we're at it so we can get some stuff clarified and possibly make a new post into a sticky. Could you please review and/or clarify the attributes of a stat. I've listed them below with what I thought they are used for.

Attribute: GroupName
Description: Tells HM to which group of the stats selection screen the stat has to be added
Value:
default (for Default stats
Preflop by position (for Preflop by position)
Flop (obvious)
Turn (obvious)
River (obvious)
3bet (for 3bet/4bet)
Preflop (for Misc preflop)
steal (obvious)
EV (for EV stats)
postflop (for Overall postflop)
xx (for Misc stats)
Example
GroupName="Default"

Attribute: ColumnName
Description: I think this is just has to be a unique identifier for the column, but need more clarification on this.
Value: <string>
Example:
ColumnName="Rakeback"

Attribute: ValueExpressions
Description: Allows you to do SQL expressions? It seems to be the part between the SELECT and FROM keywords of a normal SQL query.
Value: I think it's only SQL expressions here
Example:
Sum(PH.RakeAmount)/100.0*0.27 as RakeBackAmount

Attribute: Evaluate
Description: The output of the ValueExpressions attribute above can be further worked on here. This is the final value that is shown in the column.
Value: not sure but you can do arithmetic here
Example:
Evaluate="RakeBackAmount"

Attribute: ColumnHeader
Description: The title of the column
Value: <string>
Example:
ColumnHeader="Rakeback"

Attribute: ColumnFormat
Description: The format of data shown in the column
Value: numeric with possibly a $ as prefix
Example:
ColumnFormat="$0.00"
ColumnFormat="0"
ColumnFormat="0.0"

Attribute: ColumnWidth="*"
Description: the default starting size of the column
Value: size of the column in pixels (correct?), * means auto fit?
Example:
ColumnWidth="*"

Attribute: Tooltip
Description: The text shown when you hover over the stat
Value: <some string>
Example:
Tooltip="Rakeback based on 27%"

Also if it's not clarified yet by reviewing the above, could you explain the difference between ValueExpressions and Evaluate?

Thanks

00Blitz
08-21-2009, 05:37 AM
bump...

TheZepper
08-22-2009, 03:14 PM
It seems to me 00Blitz has it covered (however, I'm looking forward to Roy's response), but if it helps, Evaluate is merely a PRINTING instruction, and, as such, any further calculations that u can perform here are extremely limited - pretty much to add, subtract, multiply and divide the results of your ValueExpressions.

Drahnreb2
08-26-2009, 04:34 AM
Where can you lookup the list that has the names like PH.RakeAmount (and other examples are; GT.BigBlind, etc)?


I also would be very interesd to know the contents of:
PH PlayerHandsCash
PHMISC PlayerHandsCash(or Tourney)Miss
GT GameType
PKH
etc.

Is there a list somewhere?

Thanks in advance!

TheZepper
08-26-2009, 05:13 PM
Drahnreb2:

Open pgAdminIII, then open (click on plus sign) your database, schemas, public, tables, the table you want (PH,PHMISC,etc) then columns....

Drahnreb2
08-27-2009, 05:08 AM
Thanks

Drahnreb2
08-27-2009, 11:35 AM
Drahnreb2:

Open pgAdminIII, then open (click on plus sign) your database, schemas, public, tables, the table you want (PH,PHMISC,etc) then columns....

I wanted to find out which values maxstreetseen can have.
In the database it shows: Distinct Values: 5; Most Common (0,1,4,2,3).

What do the values stand for? I assume 1=pre flop, 2=flop, 3=turn, 4=river.
What does 0 stand for?
Is there a List where I can find this all variable values?

Thanks in advance again!

Drahnreb2
09-03-2009, 09:20 AM
Does nobody know, or is my question so stupid?

fozzy71
09-03-2009, 10:44 AM
I have forwarded this thread to the developer for a reply.

Rvg72
09-03-2009, 01:43 PM
I wanted to find out which values maxstreetseen can have.
In the database it shows: Distinct Values: 5; Most Common (0,1,4,2,3).

What do the values stand for? I assume 1=pre flop, 2=flop, 3=turn, 4=river.
What does 0 stand for?
Is there a List where I can find this all variable values?

Thanks in advance again!

0 = preflop, 1 = flop, 2 = turn, 3 = river, 4 = showdown

borsaci007
09-14-2009, 04:49 PM
Rvg72 wrote in the following thread:
http://holdemmanager.net/forum/showthread.php?t=282

PH PlayerHandsCash(or Tourney)KeyColumns
PHMISC PlayerHandsCash(or Tourney)Miss
GT GameType
PKH PokerHands
FLOP PlayerHandsFlop
TURN PlayerHandsTurn
RIVER PlayerHandsRiver
TABLES Tables
HOLECARDS HoleCards
EV AllInSituations

After this we all want to know, if there is a list with these "PH EV HOLECARD ..."


TheZepper wrote


Open pgAdminIII, then open (click on plus sign) your database, schemas, public, tables, the table you want (PH,PHMISC,etc) then columns....

I opened pgAdminIII, but I could not find for examble "PH".
Instead I found "pokerhands". Is this the same ?
Is there a list with all these prefixed like "PH PHMISC" ?

Hero a picture of my pgAdminIII

http://www.abload.de/img/00q93c.jpg (http://www.abload.de/image.php?img=00q93c.jpg)

lovetoplaypoker
09-17-2009, 03:51 PM
bump, yeah we need all prefix mapping to the actual database table.
I assume all 50 tables in our database has a prefix that we can use in our custom stat/report.

thanks

lovetoplaypoker
09-17-2009, 04:48 PM
There are some that do not specify any prefix, it seems to directly address the column in a table

In the WinningsSummary.Report
FieldExpression="GameTypeDescription"
which does not use any prefix, or the table name, it seems to directly address the column in the table gamestyple.
so we can directly use GameTypeDescription instead of GT.GameTypeDescription?
(I have tried modify the WinningsSummary.Report for both, both works fine)

some of those listed below

PreflopActivity.Report
FieldExpression="preflopaction_ID"

Position.Report
FieldExpression="PositionType_ID"

I didn't investigage if those are unique column, so I wonder if those column name are unique in our database, we do not need to use prefix to point to the table?

Also, I would like to know PKH is point to PokerHands or PokerHands_Hero table?

Thanks

Rvg72
09-21-2009, 12:28 AM
Guys, these are the tables you can currently map to:

PH = PlayerHandsCash(or Tourney)KeyColumns
PHMISC = PlayerHandsCash(or Tourney)Miss
GT = GameType
PKH = PokerHands
FLOP = PlayerHandsFlop
TURN = PlayerHandsTurn
RIVER = PlayerHandsRiver
TABLES = Tables
HOLECARDS = HoleCards
EV = AllInSituations

Other tables can be added easily enough if needed and if the dynamic joining can support it.

Roy

TheZepper
09-25-2009, 06:42 PM
I kmow this is too much to ask for, but how about compiledplayerresults et. al.????
Sure would save a lot of time on lots of custom stats.

Thanks again,

TheZepper

Changer
09-27-2009, 11:35 AM
And what about the values for each of these fields? These are used in the ranges for the reports so it would be nice to know what each ID stands for (especially since I have a few ideas to try out with the "In" technique). I have been desperately searching for a list of this information after reading this posted over a year ago:


Here I am identifying actual hand value ID's and assigning them into one of 4 groups. Again this is a case where you need to know what the ID's represent but this will all be documented.

I added the emphasis because I can't find any documentation, only this thread. Am I looking in the wrong spot? Can someone point me in the right direction?

Antidote
09-29-2009, 10:12 PM
I am making a custom stat that has a very long column name. I would like it so each word on the column name gets its own separate line. Here is what I would like it to like (this is just an example, not the actual stat or stat name):

Call
Turn
Cbet

But this is how it shows up as:
Call Turn Cbet

How do I get each word on a separate line?

Thanks.

TheZepper
10-03-2009, 06:43 PM
Call\nTurn\nCBet.... but I think 3 lines (rows) is the limit for ColumnHeaders.

8sunridge
04-04-2010, 06:38 PM
I see that there have been various requests for a list of the database fields, but so far it seems that this has not been provided. This seems very poor. There is a lot of very useful, powerful information within the database but there is virtually no guidance on how to extract/report it. For example, within the standard reports this field is used: FLOP.MadeHandValue. But it's quite clear from the context that you have to know what the possible values mean in order to interpret the results. There are quite a few other fields like this one, but no list of them, or explanation of the values is given anywhere. Why not?

fozzy71
04-05-2010, 02:30 PM
I see that there have been various requests for a list of the database fields, but so far it seems that this has not been provided. This seems very poor. There is a lot of very useful, powerful information within the database but there is virtually no guidance on how to extract/report it. For example, within the standard reports this field is used: FLOP.MadeHandValue. But it's quite clear from the context that you have to know what the possible values mean in order to interpret the results. There are quite a few other fields like this one, but no list of them, or explanation of the values is given anywhere. Why not?


http://forums.holdemmanager.com/manager-bugs/28382-why-thread-locked.html#post137617


There isnt an official schema available, it usually describes what each table and column is but if you use PGadminIII (Start > Programs > PostgreSQL > PGadmin III) login and click on the database you use, expand the database node > expand the schema node > expand the public Node > expand the table node. Then youll see all the tables, if you right click on any table you can select view last 100 and it will show you the values of the last 100 rows. Thats how i checkout the database and i guess its a matter of playing around with the different filters etc that gets you more familiar with it

8sunridge
04-05-2010, 04:59 PM
There isnt an official schema available

Why not?

morny
04-05-2010, 06:52 PM
This is the 3rd thread where you asked the same question, i answered in the other 2 threads already, please dont double post as it just makes extra work for us:)

If you'd like an official Schema please vote for it Suggestions Forums - Holdem Manager Forums (http://forums.holdemmanager.com/suggestions-forums/) but its currently not high on our priority list due to the reasons i pointed out in the other replies