HUD- call steal in bb

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

HUD- call steal in bb

Postby robjow » Tue Feb 24, 2009 1:20 pm

Hi, I would like this stat for Heads up. PT3 already has a fold BB to steal but calling a steal in th bb would be much more useful. I havent made a customized stats before. Can anyone help me do this?

Regards

Rob
robjow
 
Posts: 5
Joined: Tue Sep 23, 2008 10:03 am

Re: HUD- call steal in bb

Postby kraada » Tue Feb 24, 2009 1:34 pm

Rob,

You might want to read the Custom Statistics Guide on the documentation page for a general overview of how to create custom stats.

That said, for this particular stat you want to create a new column in the Holdem Cash Player Statistics section, call it cnt_bb_steal_call and give it the following value expression:

sum(if[ holdem_hand_player_statistics.flg_blind_b and holdem_hand_player_statistics.flg_blind_def_opp and lookup_actions_p.action LIKE 'C', 1, 0])

This counts up the number of times you: were in the big blind, had a steal defense opportunity, and your first action was fold (you could use the flg_p_fold field but then it'd count the times you 3-bet and folded to a 4-bet).

Then go to the stats tab, and the easiest place to start is likely duplicating the Fold BB to steal, you'll want to change the name, use your new column instead of cnt_bb_steal_fold, and change the description and title on the format tab appropriately. Save the stat, update your cache and you should be all set.

Edited: Fixed a couple of minor errors in the value expression.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: HUD- call steal in bb

Postby robjow » Wed Feb 25, 2009 11:32 pm

Hi, thanks for the quick reply,

I entered the value expression 'sum(if[ holdem_hand_player_statistics.flg_blind_b and holdem_hand_player_statistics.flg_blind_steal_def_opp and substring(lookup_actions_p.action from 1 for 1 = 'F'), 1, 0])' but when i tried to save it said it wasnt valid SQL?

rob
robjow
 
Posts: 5
Joined: Tue Sep 23, 2008 10:03 am

Re: HUD- call steal in bb

Postby stevi3p » Thu Feb 26, 2009 9:40 am

Kraada, your stat is for Fold rather than Call??
stevi3p
 
Posts: 71
Joined: Thu Mar 13, 2008 3:00 pm

Re: HUD- call steal in bb

Postby kraada » Thu Feb 26, 2009 10:21 am

Apologies for the typo, the original version would be fold to steal in BB. Change the F to a C (I've edited the post accordingly), and it'll be for calls.

Edit to add: I also changed the way the substring works slightly to be more efficient. The above SQL should validate now.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: HUD- call steal in bb

Postby preparac » Sat Feb 28, 2009 6:39 am

Thank you for this one also. 2 Questions:

1) What does "LIKE" mean/do in the expression: lookup_actions_p.action LIKE 'C' ??

2) As a sidenote, I think we still have minor problems to catch all cases in the SB even with this expression (BB works fine)

When I put together a report with the 3 stats Fold/Call/Raise to Steal Att from SB, i do net get 100%, but slightly less, so I think we are missing a few cases (probably 4Betting cases?). This happens in both cases with (a)
(a1) sum(if[tourney_holdem_hand_player_statistics.flg_sb_steal_fold, 1, 0]) +
(a2) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_def_opp AND tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.cnt_p_raise > 0, 1, 0]) +
(a3) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action LIKE 'C', 1, 0])

and with (b)
(b1) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action LIKE 'F', 1, 0]) +
(b2) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action LIKE 'R', 1, 0]) +
(b3) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action LIKE 'C', 1, 0])

In case (b) there are missing even a few hands more (because (a2) > (b2))
((( and somewhere inbetween comes my old self constructed column:
(c2) sum(if[tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND tourney_holdem_hand_player_statistics.flg_p_3bet, 1 , 0 ]) )))

The error is < 1% in average, so I can live with it and I do not have the ability to figure out exactly where the problem is, but I wanted to let you know ....
preparac
 
Posts: 323
Joined: Thu May 15, 2008 6:23 am

Re: HUD- call steal in bb

Postby WhiteRider » Sat Feb 28, 2009 7:46 am

1. LIKE is an SQL statement which compares strings.
LIKE 'C' means the actions string is exactly 'C'.

2. ..and now that I write that I wonder if that is the problem here.
Try changing it to LIKE 'C%' which will include hands where you check and then make another action(s), which can happen if you call and the BB raises - I think this may be where your missing cases are coming from.
If that doesn't fix it, please post back and I'll investigate further.

Have a look at the Postgres documentation for LIKE.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: HUD- call steal in bb

Postby preparac » Sat Feb 28, 2009 9:18 am

Thanks and Yes, it works with LIKE 'C%' , but we still have to pay attention what cases we actually put together.

so I get correct results for F/C/R to St Att in the SB whe I use together the colums
(a)
(a1) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action LIKE 'F', 1, 0]) +
(a2) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action LIKE 'R', 1, 0]) +
(a3) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action LIKE 'C%', 1, 0])

but also when I use (b)
(b1) sum(if[tourney_holdem_hand_player_statistics.flg_sb_steal_fold, 1, 0]) +
(b2) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_def_opp AND tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.cnt_p_raise > 0, 1, 0]) +
(b3) sum(if[tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND tourney_holdem_hand_player_statistics.cnt_p_raise = 0 AND tourney_holdem_hand_player_statistics.cnt_p_call > 0, 1 , 0 ])

The difference is not big, but for a few players (a2) < (b2) and (a3) > (b3). This means, I think, that with LIKE 'C%' we also count cases where we first called in the SB and then reraised (4Bet) after a raise (3Bet) from the BB ... what you think?
preparac
 
Posts: 323
Joined: Thu May 15, 2008 6:23 am

Re: HUD- call steal in bb

Postby preparac » Sat Feb 28, 2009 10:23 am

This SB-Stuff seems to confuse me every time at some point
Now when I tried to put together the controlled stats this didn't work like I told before

with
(a1) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action LIKE 'F', 1, 0]) +
(a2) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action LIKE 'R', 1, 0]) +
(a3) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action LIKE 'C%', 1, 0])

I'm still missing a few cases, ALSO in the BB (wenn I use this collums) ... I probably messed up something but can't figure it out for the moment, drives me nuts...

I get clean stats (no missing hands ...) with the colums (SB)

(b1) sum(if[tourney_holdem_hand_player_statistics.flg_sb_steal_fold, 1, 0]) or what is the same
(b1) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action LIKE 'F', 1, 0])
(b2) sum(if[tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND tourney_holdem_hand_player_statistics.flg_p_3bet, 1 , 0 ])
(b3) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_s AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action LIKE 'C%', 1, 0])

and the colums (BB)
(b4) sum(if[tourney_holdem_hand_player_statistics.flg_bb_steal_fold, 1, 0])
(b5) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_def_opp AND tourney_holdem_hand_player_statistics.flg_blind_b AND tourney_holdem_hand_player_statistics.cnt_p_raise > 0, 1, 0])
(b6) sum( if[ tourney_holdem_hand_player_statistics.flg_blind_b AND tourney_holdem_hand_player_statistics.flg_blind_def_opp AND lookup_actions_p.action LIKE 'C', 1, 0])

Still I'm little bit confused where I count now which Call-4bet cases ...
preparac
 
Posts: 323
Joined: Thu May 15, 2008 6:23 am

Re: HUD- call steal in bb

Postby WhiteRider » Sat Feb 28, 2009 10:45 am

You will also need to use LIKE 'R%' because you can face action after you raise, too. Obviously you won't need to do this for LIKE 'F' because you can never face any action after you fold.

I would use the exact same construction for your BB cases as for SB - i.e. use LIKE.

What a player does when facing a steal should be completely independent of what happens afterwards, because when they are facing a steal they don't know what will happen after that - so 4-bets are irrelevant. If they face a 4-bet at their first action then they are not facing a "steal" so they won't count in these stats anyway.
WhiteRider
Moderator
 
Posts: 54025
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Next

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

Who is online

Users browsing this forum: No registered users and 12 guests