Page 1 of 3

MTT information stats

PostPosted: Tue Oct 13, 2020 3:00 am
by sam_hawkins
Hi!

I have been looking around the forum and could not find an answer to my question, so I decided to ask it myself.

I am trying to build an MTT statistic that will be calculated for every hand (so I suppose it would be a T(ourney)/hand statistic) so that I can plot it on a graph as an overlay stat.

The formula I am trying to write down should calculate the amount of chips won scaled by some coefficient that takes into account some sort of money value and should look something like this:

custom_stat = amt_chips_won * amt_buyin/ starting_stack

What I need:

The information I cannot find is the 'starting_stack' amt. I found the code for how to get the number for summaries (for example here) but not as a hand statistic. Can somebody help me how to write a starting stack stat that can be accessed in the above calculation?

Thank you!!

Re: MTT information stats

PostPosted: Tue Oct 13, 2020 7:47 am
by Flag_Hippo
sam_hawkins wrote:I am trying to build an MTT statistic that will be calculated for every hand (so I suppose it would be a T(ourney)/hand statistic) so that I can plot it on a graph as an overlay stat.

If you want a statistic calculated for every hand and display results in a graph it will need to be a player statistic and not a hand statistic. A hand statistic is for use in a hand report (listing individual hands) and only player statistics are available for graphs.
sam_hawkins wrote:The information I cannot find is the 'starting_stack' amt. I found the code for how to get the number for summaries (for example here) but not as a hand statistic. Can somebody help me how to write a starting stack stat that can be accessed in the above calculation?

A players starting stack isn't something that is stored directly in the database schema but there is SQL in the thread you linked however creating/using that type of SQL is beyond my own knowledge I'm afraid.

Re: MTT information stats

PostPosted: Tue Oct 13, 2020 5:55 pm
by sam_hawkins
Thank you for your reply! I expected that some sort of modification of the SQL code I linked will be the answer to my question but unfortunately I only know python myself. Do you think anyone will be able to help from the PT4 team?

Re: MTT information stats

PostPosted: Wed Oct 14, 2020 2:05 am
by sam_hawkins
Or, alternatively, where can I found the SQL codes for other stats so I can try to figure it out myself? For example, where can I find the code for 'amt_chips_won' ?

Re: MTT information stats

PostPosted: Wed Oct 14, 2020 1:27 pm
by Flag_Hippo
You can see the code for all existing columns in 'Configure -> Statistics -> Columns'.

Re: MTT information stats

PostPosted: Wed Oct 14, 2020 3:05 pm
by sam_hawkins
Yeah I found that, thanks! I think I managed to create the proper column for amt_starting_stack but when I create the custom stat, I cannot find it as an overlay stat in the graph (I think this is related to where the information comes from in the database) so I'm not sure I can do this on my own.

Re: MTT information stats

PostPosted: Thu Oct 15, 2020 5:16 am
by Flag_Hippo
Please export your custom statistic, compress it and attach it here.

Re: MTT information stats

PostPosted: Sat Oct 17, 2020 5:24 am
by sam_hawkins
Here is the statistic, dunno if it is correct. The column starting stack is
Code: Select all
first_value(tourney_hand_player_statistics.amt_before) over
(partition by tourney_hand_player_statistics.id_tourney order by tourney_hand_player_statistics.date_played)

Re: MTT information stats

PostPosted: Sat Oct 17, 2020 8:40 am
by WhiteRider
I'm don't think that that will work as a Player stat. Your expression wants to have a single value, but across all hands for a player there would be multiple values so the result would be undefined.
For example in a Player stat "amt_won" is the total amount of chips won or lost across all of the hands, but your "amt_starting_stack" is [trying to be] the starting stack in a single hand, and that won't work.

You may be able to get it to work by doing the whole calculation in a column, but you're mixing different levels of data (hand data and overall tournament data) and I think that still won't work.

Re: MTT information stats

PostPosted: Sun Oct 18, 2020 4:49 am
by sam_hawkins
WhiteRider wrote:I'm don't think that that will work as a Player stat. Your expression wants to have a single value, but across all hands for a player there would be multiple values so the result would be undefined.
For example in a Player stat "amt_won" is the total amount of chips won or lost across all of the hands, but your "amt_starting_stack" is [trying to be] the starting stack in a single hand, and that won't work.

You may be able to get it to work by doing the whole calculation in a column, but you're mixing different levels of data (hand data and overall tournament data) and I think that still won't work.


Thank you, that's the kind of insight into how the stats work I was looking for. Could you please explain why exactly is it a problem that the stat takes different values across different hands? I think I am not exactly understanding what is different from 'amt_won' -- there, my understanding is that it calculates the amt of chips won in each single hand and then when graphing you just want to graph a cumulative sum. Still, if I check amt_won for several individual hands, it will return the amt of chips individually for each hand. Am I mistaken somehow? Because that is exactly how I would like the amt_starting_stack column to work, a value assigned to each hand separately (but with the added property that this value will be the same for all hands for a given tourney), except it would not make sense to plot the cumulative sum.

I do understand the mixing of 'summary' data with 'hand' data, but I would be surprised if that was not possible, just define the summary data as hand data that is stationary over some subset of hands, right?