noob´s questions regarding custom stat programming

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

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

noob´s questions regarding custom stat programming

Postby ommaha » Mon Aug 13, 2012 7:58 pm

Hi,

I started creating custom stats. Unfortunately, I am not very good at it.
I want to create a custom stat that shows me how often a player folds to a cbet when he is in position (cbetter is out of position).
So, it perhaps is (cnt_f_cbet_def_action_fold_in_pos / cnt_f_cbet_def_opp) * 100 ?

But I am not sure whether cnt_f_cbet_def_opp is right here because it is to be the "number of times a player faced a cbet on the flop". I assume this is not the same ( i.e. a higher) number as "number of times a player faced a cbet on the flop WHEN IN POSITION" (?)

If it is not the same do I have to add "AND cash_hand_player_statistics.flg_f_has_position" or "AND NOT cash_hand_player_statistics.flg_f_has_position"?
I do not understand if "cash_hand_player_statistics.flg_f_has_position" refers to the cbetter or not. Where do I know from?

Thanks very much for any help
ommaha
 
Posts: 228
Joined: Sun Jul 29, 2012 8:46 am

Re: noob´s questions regarding custom stat programming

Postby ommaha » Tue Aug 14, 2012 7:56 am

I kept on trying but I face the same problem anytime (with donking stats for example). How can I see which player is adressed when I want to use more than one in the expression-field?
Is there a possibility to name the players like player1, player2 or similar? Or is it not possible to use two or more players when programming a stat in general?
ommaha
 
Posts: 228
Joined: Sun Jul 29, 2012 8:46 am

Re: noob´s questions regarding custom stat programming

Postby kraada » Tue Aug 14, 2012 10:06 am

Showing in and out of position stats in PT4 for use in the HUD doesn't require the use of custom statistics - all you need to do is add the stat you want (say Fold to F CBet) to the HUD and then click on it and in the Item Properties area change the value in Has Position to "In Position on the Flop". This will work for any postflop stat and will probably make your life a lot easier.

If you were using this as an example to learn more about our custom statistics interface though, I will gladly help you understand further what is going on here - but if this is your final goal, there's no reason to build these stats.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: noob´s questions regarding custom stat programming

Postby ommaha » Tue Aug 14, 2012 11:24 am

Thanks very much.

This was a good idea and helps me. I am not sure whether I would ever have detected that possibility on my own ;) .


But it was more meant as an example. The final goal is to be able to create stats like fold2cbet in sandwich position when 3 players see a flop and when cbetter is first to act on a monotone flop. I know that it is a long way to reach that level but I want to learn.
Is there a guide for programming these stats or any link that shows examples too? I just found https://www.pokertracker.com/guides/PT3 ... tics-guide which is good but does not help me a lot at the moment without full examples because I have to learn before how syntax is built and about the different functions. I learned pql just by looking up examples with whole syntax in description in http://propokertools.com/pql. This worked out real good for me and now I can do heavy stuff in pql even if I am bad at programming. Is there a guide or something similar with syntax examples like those used for pql on pokertracker.com?

On problems like
ommaha wrote:If it is not the same do I have to add "AND cash_hand_player_statistics.flg_f_has_position" or "AND NOT cash_hand_player_statistics.flg_f_has_position"?
I do not understand if "cash_hand_player_statistics.flg_f_has_position" refers to the cbetter or not. Where do I know from?


I usually try out such things and find out myself if it is "AND" or "AND NOT". Is there a possibility to use a custom stat as a filter in pokertracker reports? So, it would be easy to find out myself by clicking through like 30 hands and to see whether filter works right. I could be sure that the custom stat works probably then.

Thanks very much
ommaha
 
Posts: 228
Joined: Sun Jul 29, 2012 8:46 am

Re: noob´s questions regarding custom stat programming

Postby kraada » Tue Aug 14, 2012 2:18 pm

Sure, I can definitely help you get there. Just if this was your final goal I figured you'd appreciate being able to skip all of the work ;)

Basically what you often want to be building are new columns if you want very specific combinations of circumstances. The columns are what give the stats the total number of times specific things have happened. For example, cnt_f_cbet is how many times a player cbet the flop and it's a number. You can't use AND to combine that number with anything else (though you can of course add, subtract, multiply or divide it). What you can do in the column is change the circumstances by which things are added or subtracted.

Take a look on the Columns page at the various columns and their descriptions. We have a lot of examples to look at and they should start giving you an idea how these are constructed. The basic framework used most often is:
sum(if[CONDITION, 1, 0])

which adds up the number of times CONDITION is true. You can create custom reports that filter on conditions also - create a report in the Hand section and click the blue Filters link and add a filter expression. You can paste the CONDITION part right in and it will filter to situations where that's true.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 4 guests