bet turn oop% when chcked through on flop

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

bet turn oop% when chcked through on flop

Postby blake » Sat Jan 23, 2010 10:41 pm

i am trying to write a code for the % a out of position player bets the turn when the flop is checked through... this is my first code i have written and it is very very confusing for me so i think there will be a lot of mistakes so can you please help me
(sum(if[holdem_hand_player_statistics.cnt_p_raise > 0 AND holdem_hand_player_statistics.flg_f_saw AND substring(lookup_actions_f.action from 1 for 1 AND if holdem_hand_player_statistics.flg_t_bet='X', 1, 0])/sum(if[holdem_hand_player_statistics.cnt_p_raise > 0 AND holdem_hand_player_statistics.flg_f_saw AND substring(lookup_actions_f.action from 1 for 1 AND if holdem_hand_player_statistics.flg_t_bet_opp='X', 1, 0]))*100
blake
 
Posts: 5
Joined: Tue Apr 15, 2008 7:11 pm

Re: bet turn oop% when chcked through on flop

Postby WhiteRider » Sun Jan 24, 2010 5:58 am

You're on the right lines, but that is a bit messy.. ;)

Firstly, you need to create two separate columns to count the times the player made the action, and the times they had the opportunity to make the action.

For both you're trying to count how many times a certain situation happens, so you need to structure the expression like this:
sum( if[ expression, 1, 0 ] )
That says: if the expression is true for this hand add 1, if not add 0. This will be done for every hand, so count up the number of hands for which the expression was true.

Some detail:

substring(lookup_actions_f.action from 1 for 1 AND if holdem_hand_player_statistics.flg_t_bet='X', 1, 0])
..won't work.
You need to compare:
substring(lookup_actions_f.action from 1 for 1) with something: e.g. substring(lookup_actions_f.action from 1 for 1) = 'X'.
An easier way to do this is to use LIKE:
lookup_actions_f.action LIKE 'X%'
..means that the first character was X (check). Here, though, you want to see if the flop actions were check only, so you can just use =.
lookup_actions_f.action = 'X'

holdem_hand_player_statistics.flg_t_bet is a boolean value (true or false), so you can't compare it with a string.

Let's ignore position initially, as that complicates things further - let's just count times the player bet the turn when the flop was checked through. We can come back and add more detail later.
Since you used "holdem_hand_player_statistics.cnt_p_raise > 0" I guess you want this for raised pots only, but you probably want hands where the player faced a raise, rather than making the raise themself? That would be holdem_hand_player_statistics.flg_p_face_raise.

cnt_t_bet_after_flop_checked =
sum( if[ holdem_hand_player_statistics.flg_p_face_raise AND lookup_actions_f.action='X' AND lookup_actions_t.action='B%', 1, 0 ] )

cnt_t_open_opp_after_flop_checked =
sum( if[ holdem_hand_player_statistics.flg_p_face_raise AND lookup_actions_f.action='X' AND holdem_hand_player_detail.flg_t_open_opp, 1, 0 ] )

Please read the Tutorial - Custom Reports and Statistics for more detail and for how to display these columns in a stat.
Use of actions strings (LIKE, etc) is described there, as well as the general structure of stats, etc.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 0 guests