Checking profitabiity of certain moves...

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

Checking profitabiity of certain moves...

Postby stasia42 » Wed Sep 30, 2009 11:14 am

Hey there, I'm currently working on self-examing stats, to see if certain moves I make are profitable or not. Specifically, I'm trying to see a certain situation, where SB RFI, and I call from BB. I noticed the stat "amt_won" and trying to see how can I make it work for certain situations with an "IF" condition.

The stat I'm trying to build is "Amt_WON_when_BB_calls_SB_RFI"...

"Amt_WON_when_BB_calls_SB_RFI" = "Amt_won_BB_vs_SB" / "cnt_hands_with_flop_bb_vs_sb"

where "Amt_won_BB_vs_SB" is ????

and "cnt_hands_with_flop_bb_vs_sb" is:

sum(if[holdem_hand_player_statistics.position = 8 AND
holdem_hand_player_detail.val_p_raise_aggressor_pos = 9 AND
holdem_hand_player_statistics.flg_blind_def_opp AND NOT
(holdem_hand_player_statistics.flg_p_3bet_def_opp) AND NOT
(holdem_hand_player_statistics.flg_p_3bet) AND
holdem_hand_summary.cnt_players_f > 0, 1, 0])

How do I make an "IF" condition to make the "Amt_won_BB_vs_SB" work?
stasia42
 
Posts: 35
Joined: Tue Aug 25, 2009 12:51 pm

Re: Checking profitabiity of certain moves...

Postby kraada » Wed Sep 30, 2009 11:37 am

Create a new column:

amt_won_sb_vs_bb:

sum(if[holdem_hand_player_statistics.position = 8 AND ((holdem_hand_player_statistics.flg_f_has_position AND holdem_hand_summary.cnt_players_f > 0) OR (holdem_hand_player_detail.val_p_raise_aggressor_pos = 9 AND NOT(holdem_hand_player_statistics.cnt_p_raise = 0 AND holdem_hand_player_statistics.flg_p_3bet_def_opp)), holdem_hand_player_statistics.amt_won, 0])

This checks to see that (a) you are in the BB, and one of two things happens:
(b) You have position on the flop that people saw - the only way this can happen is if the only players in the pot are you and the SB.
or (c) The SB is the last person to raise preflop, and you only face a 3-bet if you raised. We want to filter out cases where the BTN opens and SB 3-bets - now you, in the BB, face a 3-bet. But we need there to be cases taken into account when the SB limp-reraises. But that only happens if you raise - so if you don't raise and you are facing a 3-bet, someone else before the SB must have opened. I believe that takes care of all of the cases . . .

Then we add the amount you won to the column.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Checking profitabiity of certain moves...

Postby stasia42 » Wed Sep 30, 2009 12:02 pm

Hi there, and thanks for the quick reply....

I'm trying to isolate situation where the SB RFI, and I'm on the BB, calling. I understand what you are saying, will this work for the "amt_won_sb_vs_bb" column, cause I'm kinda lost with the part where u try to figure out if there was an earier bet, before the SB:

sum(if[holdem_hand_player_statistics.position = 8 {If I'm on the BB} AND
holdem_hand_player_detail.val_p_raise_aggressor_pos = 9 {If the SB is the aggressor} AND
holdem_hand_player_statistics.flg_p_first_raise {If there are no previous limpers, and no previos bets} AND
holdem_hand_player_statistics.flg_blind_def_opp {If my blind is facing a steal attempt, guess I don't really need it, cause if SB RFI, then I'm for sure facing a steal} AND NOT
holdem_hand_player_statistics.flg_p_3bet {And I don't 3Bet} AND
holdem_hand_summary.cnt_players_f = 2 {And we see flop for two people, which means I called PF}
, holdem_hand_player_statistics.amt_won, 0])

Will this work? and if not, what situations am I missing?
stasia42
 
Posts: 35
Joined: Tue Aug 25, 2009 12:51 pm

Re: Checking profitabiity of certain moves...

Postby kraada » Wed Sep 30, 2009 12:16 pm

Your stat won't work and I'll go through that after I try going through why mine works better :)

You understand (I hope) why if you see a flop, and there are two people, and you are in position the only player in the pot must have been the SB.

If you want your only preflop action to be call (I missed that part so was looking for all cases), you can actually do that much easier:

sum(if[holdem_hand_player_statistics.position = 8 AND holdem_hand_player_statistics.flg_f_has_position AND lookup_actions_p.action = 'C', holdem_hand_player_statistics.amt_won, 0])

In the above case you're in the BB, have position on the flop and your only preflop action was call. The only way your only preflop action can be call and you end up in position is if the SB opened. You will still get cases where some people limp the SB isolates, you call and all the limpers fold; I don't think that can be easily helped.

To go to your column: This won't return any results. flg_p_first_raise is true when you make the first raise and you're in the BB. But you require a blind defense opportunity, which means that someone else in late position raised to steal your blinds. You can see, I hope, why this is incompatible with you making the first raise . . .
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Checking profitabiity of certain moves...

Postby stasia42 » Wed Sep 30, 2009 2:32 pm

Hey there, from some reason I can't find anywhere in my pokertracker the "has position" flag, so I decided to go for the not-so-efficient-and-beautiful solution, but I thought about it, and I think it covers up all the necessary situations...

"SB tries steal att. , BB Calls":

sum(if[substring(lookup_actions_p.action from 1 for 1)='C' AND {If my action was to call}
holdem_hand_player_statistics.position = 8 AND {and I'm on the BB}
holdem_hand_player_detail.val_p_raise_aggressor_pos = 9 AND {And the last aggressor is the SB"
holdem_hand_player_statistics.flg_blind_def_opp,1,0]) {And I'm facing a steal att.}

Please correct me if I'm wrong, but as I understand the flg_blind_def_opp , it is set to "True" only if I'm on one of the blinds, and a blind steal attempt is going on. If I remember correctly, if the BU RFI, and the SB 3 Bets, or plain calls, then it is no longer considered a steal attempt. Same goes for previous limpers... If EP limped and SB 2 Bets, then it is not considered a steal attempt...?

I'm preferring this solution because I want to continue and deal with steal attempts from other positions, so the only change I'll need to make is the number of the position, and not the whole algorithm...

I can't see situations I miss, or situations that I don't want to count being counted, but it is all based on my understanding of this "flg_blind_def_opp" boolean and the meaning of a steal attempt...

Am I correct or not?
stasia42
 
Posts: 35
Joined: Tue Aug 25, 2009 12:51 pm

Re: Checking profitabiity of certain moves...

Postby kraada » Wed Sep 30, 2009 2:52 pm

That query will work.

My apologies I did mistype before, flg_f_has_position is in holdem_hand_player_detail, not holdem_hand_player_statistics.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Checking profitabiity of certain moves...

Postby stasia42 » Wed Sep 30, 2009 4:24 pm

Ok, I'm mainly done with previous topic, and now I'm trying to treat a situation where Button is making a steal attempt, one of the blinds flat calls, and we go to a 2Bet, HU, pot. I'm building a stat where I check how many times the original aggressor (the button) makes a Cbet...

CBet Flop (BL vs BU) = (cnt_f_cbet_BL_vs_BU / cnt_f_cbet_opp_BL_vs_BU) * 100 Where

(cnt_f_cbet_BL_vs_BU) is:
sum(if[holdem_hand_player_statistics.position = 0 AND {if aggressor is on the button}
holdem_hand_player_statistics.flg_p_open_opp AND {and he has the chance to be the first to put money in the pot}
holdem_hand_player_statistics.flg_p_first_raise AND NOT {and he decides to bet}
holdem_hand_player_statistics.flg_p_3bet_def_opp AND {and he is not facing a 3 bet from either blind}
holdem_hand_player_statistics.flg_f_saw AND {and we see flop, meaning on of the blinds called}
(holdem_hand_summary.cnt_players_f = 2) AND {and we are in a HU flop, meaning only ONE of the blinds called, and the other folded}
holdem_hand_player_statistics.flg_f_cbet_opp AND {and button has the chance to CBet, meaning the Blind had checked}
holdem_hand_player_statistics.flg_f_cbet, 1, 0]) {and he does a CBet}

And (cnt_f_cbet_opp_BL_vs_BU) is:
sum(if[holdem_hand_player_statistics.position = 0 AND
holdem_hand_player_statistics.flg_p_open_opp AND
holdem_hand_player_statistics.flg_p_first_raise AND NOT
holdem_hand_player_statistics.flg_p_3bet_def_opp AND
holdem_hand_player_statistics.flg_f_saw AND
(holdem_hand_summary.cnt_players_f = 2) AND
holdem_hand_player_statistics.flg_f_cbet_opp, 1, 0])

Did I miss any situation..? :-) sorry to bother you guys, I'm only beginning now to seriously work with the program, these rookie questions won't last long, I promise...

Thanks.
stasia42
 
Posts: 35
Joined: Tue Aug 25, 2009 12:51 pm

Re: Checking profitabiity of certain moves...

Postby kraada » Wed Sep 30, 2009 5:02 pm

Small nitpick:

holdem_hand_player_statistics.flg_p_open_opp AND holdem_hand_player_statistics.flg_p_first_raise

can be replaced with holdem_hand_player_statistics.flg_steal_att

flg_steal_att is true when a player attempts to steal the blinds. Your two checks should work, but one check is faster than two, and even though it sounds silly, since they're identical it'll save you a little bit of time when updating your cache if your database(s) should ever get large.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Checking profitabiity of certain moves...

Postby stasia42 » Wed Sep 30, 2009 8:24 pm

Great reply, will change it, I appreciate computer efficiency..:-) Thanks!
stasia42
 
Posts: 35
Joined: Tue Aug 25, 2009 12:51 pm

Re: Checking profitabiity of certain moves...

Postby marvin » Thu Oct 01, 2009 3:08 am

holdem_hand_player_statistics.flg_steal_att...

reading teh guide PDF about what is written on:
"flg_sb_steal_fold, If someone who is in stealing position attempted to steal and the player was in the small blind and folded, this is set to true, otherwise this is set to false. Stealing positions are Cut Off and Button only." it seems that this flag is used only for the CO or BU. or it says "Stealing positions are Cut Off and Button only" why it speaks about SB action (and obviuosly the stealer must be only in LP) ? IN OTHER WORD, IF SMALL BLIND IS THE FIRST RAISER, HIS flg_steal_att must be true....
marvin
 
Posts: 327
Joined: Tue Jul 08, 2008 10:17 am

Next

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

Who is online

Users browsing this forum: No registered users and 0 guests