PDA

View Full Version : Custom Script for different Rake Method



fasenderos
02-06-2011, 04:01 AM
Is this the right way to evaluate Dealt & Average & Weighted rake?
I hope that some guru will correct me..

example:

6 Max Table (BB/SB $1/$0,5)
6 Dealt Player
Hero is in BB

***PREFLOP***
Villain1 limp, Villain2to4 fold, Villain5 Complete
Tot Preflop Pot = $3

***FLOP***
Villain5 Check, Hero Bet $1, Villain1 Call, Villain5 Call
Tot Flop Pot = $6

***TURN***
Villain5 Check, Hero Bet $2, Villain1 Call, Villain5 Fold
Tot Turn Pot = $10

***RIVER***
Hero Bet $3, Villain1 Call
Tot Pot = $16
Rake 5% => (16/100)*5 = $0,8
Hero Wins the Pot = $15,2

Rake Evaluation

Dealt Method = Tot Rake/Dealt Player => $0,8/6 = $0,1333
Hero Rake = $0,1333

Average Method = Tot Rake/VPIP Player => $0,8/3 = $0,2666
Hero Rake = $0,2666

Weighted Method = % of pot contribution => Hero has contributed $7 to the pot => 7/16=X/100 =>
X= 43,75% => ($0,8/100)*43,75 = $0,35
Hero Rake = $0,35


...So in HEM Language:

Dealt Rake


Stat ColumnName="Dealt Rake" ColumnHeader="Dealt Rake" ColumnFormat="$0.00" ColumnWidth="*" Tooltip="Dealt Rake"
ValueExpressions="sum(pkh.rakeamount/pkh.numberofplayers) * 0.01 as DealtRake" Evaluate="DealtRake" />

Average Rake


Stat GroupName="Default" ColumnName="Average Rake" ValueExpressions="Sum(case when pkh.numberofplayerssawflop >= 1 and ph.didvpip=TRUE then (pkh.rakeamount/pkh.numberofplayerssawflop) * 0.01 else 0 end) as AverageRake" Evaluate="AverageRake" ColumnHeader="Average Rake" ColumnFormat="$0.00" ColumnWidth="*" Tooltip="Average Rake" />


Weighted Rake


Stat ColumnName="Weighted Rake"
ValueExpressions="sum((pkh.rakeamount/100) * (((phmisc.postamountpreflop + phmisc.betamountpreflop + phmisc.callamountpreflop + COALESCE(flop.betamount + flop.callamount, 0) + COALESCE(turn.betamount + turn.callamount, 0) + COALESCE(river.betamount + river.callamount, 0)) * 100) / pkh.potsize)) * 0.01 as WeightedRake" Evaluate="WeightedRake"
ColumnHeader="Weighted Rake" ColumnFormat="$0.00" ColumnWidth="*" Tooltip="Weighted Rake" />

Hei Guru, help me please

MindControl
02-19-2011, 06:04 PM
Is this the right way to evaluate Dealt & Average & Weighted rake?
I hope that some guru will correct me..

example:

6 Max Table (BB/SB $1/$0,5)
6 Dealt Player
Hero is in BB

***PREFLOP***
Villain1 limp, Villain2to4 fold, Villain5 Complete
Tot Preflop Pot = $3

***FLOP***
Villain5 Check, Hero Bet $1, Villain1 Call, Villain5 Call
Tot Flop Pot = $6

***TURN***
Villain5 Check, Hero Bet $2, Villain1 Call, Villain5 Fold
Tot Turn Pot = $10

***RIVER***
Hero Bet $3, Villain1 Call
Tot Pot = $16
Rake 5% => (16/100)*5 = $0,8
Hero Wins the Pot = $15,2

Rake Evaluation

Dealt Method = Tot Rake/Dealt Player => $0,8/6 = $0,1333
Hero Rake = $0,1333

Average Method = Tot Rake/VPIP Player => $0,8/3 = $0,2666
Hero Rake = $0,2666

Weighted Method = % of pot contribution => Hero has contributed $7 to the pot => 7/16=X/100 =>
X= 43,75% => ($0,8/100)*43,75 = $0,35
Hero Rake = $0,35


...So in HEM Language:

Dealt Rake



Average Rake




Weighted Rake



Hei Guru, help me please

No,
Average Method = Total Rake/Number Of Players, Which Invested Money-this means,that if the big blind folded in the preflop stage, but SB called to Dealer preflop raise the number of players is 3, if CO opened, Dealer called and both blinds folded, the number is 4. I found no way to calculate it with the database, do you have any idea how to do that? I looked all the field in all the tables, but there is not the fields which I need to do that: the simplest I can think of is to see whether or not SB and BB folded preflop.
Your method for calculating the Weighted is wrong too, because your calculation includes uncalled bets: they do not contribute to rake.If someone pushes 100 blinds in pot 12 blinds and everyone folds on the flop your method will calculate that this player will get quite huge part from the rake.
For it, too, I can't figure out a way to calculate it right :( It is a big mystery how it is calculated in HoldemManager. Maybe on the import stage it gets the information directly from the hand history about blind's actions and the real player's investment?

fasenderos
02-23-2011, 05:43 AM
Thanks for your clarification...


No,
Average Method = Total Rake/Number Of Players, Which Invested Money-this means,that if the big blind folded in the preflop stage, but SB called to Dealer preflop raise the number of players is 3, if CO opened, Dealer called and both blinds folded, the number is 4. I found no way to calculate it with the database, do you have any idea how to do that? I looked all the field in all the tables, but there is not the fields which I need to do that: the simplest I can think of is to see whether or not SB and BB folded preflop

For the Average method, i'm trying with phmisc.offthebutton to se if the SB or BB folded preflop, but there is something wrong in my code:



<Stat GroupName="Default" ColumnName="Avarage Rake"

ValueExpressions="sum(case when ph.numberofplayers = 6 and phmisc.offthebutton = 5 and ph.preflopaction_id = -1 then 1 else 0 end) as sixplayers_SBfold;

sum(case when ph.numberofplayers = 6 and phmisc.offthebutton = 4 and ph.preflopaction_id = -1 then 1 else 0 end) as sixplayers_BBfold;

sum(case when ph.numberofplayers = 5 and phmisc.offthebutton = 4 and ph.preflopaction_id = -1 then 1 else 0 end) as fiveplayers_SBfold;

sum(case when ph.numberofplayers = 5 and phmisc.offthebutton = 3 and ph.preflopaction_id = -1 then 1 else 0 end) as fiveplayers_BBfold;

sum(case when ph.numberofplayers = 4 and phmisc.offthebutton = 3 and ph.preflopaction_id = -1 then 1 else 0 end) as fourplayers_SBfold;

sum(case when ph.numberofplayers = 4 and phmisc.offthebutton = 2 and ph.preflopaction_id = -1 then 1 else 0 end) as fourplayers_BBfold;

sum(ph.rakeamount)/100.0 as rakeamount;

sum(pkh.numberofplayerssawflop)/1 as numberofplayerssawflop"

Evaluate="rakeamount/(numberopplayerssawflop + sixplayers_SBfold + sixplayers_BBfold + fiveplayers_SBfold + fiveplayers_BBfold + fourplayers_SBfold + fourplayers_BBfold)"

ColumnHeader="Avarage Rake" ColumnFormat="$0.00" ColumnWidth="*" Tooltip="Avarage Rake" />



any idea?

fasenderos
02-26-2011, 04:49 AM
I have two questions..

First, with this code:


when ph.positiontype_id <= 1 and ph.didvpip=FALSE then 2 else 0
i get 2 only when player in position 1 and 0 do not VPIP ?

Second, with this code:


when ph.positiontype_id = 1 and ph.didvpip=FALSE and ph.positiontype_id = 0 and ph.didvpip=TRUE then 1 else 0


i get 1 only when player in position 1 do not VPIP and player in position 0 has VPIP ?

Thanks

Finnisher
02-23-2012, 03:44 PM
Are these stats correct? MGR/100 is supposed to be whatever HEM uses as rake/mgr in bb/100.

<Stat GroupName="Default" ColumnName="MGR bb/100" ColumnHeader="MGR\nbb/100" ValueExpressions="Sum(PH.RakeAmount/1.0/gt.bigblind)as MGR100" Evaluate="MGR100/totalhands*100"
ColumnHeader="MGR\n/ 100" ColumnFormat="0.00" ColumnWidth="*" Tooltip="MGR per 100 Hands" />

<Stat ColumnName="Dealt Rake" ColumnHeader="Dealt Rake" ColumnFormat="$0.00" ColumnWidth="*" Tooltip="Dealt Rake"
ValueExpressions="sum(pkh.rakeamount/pkh.numberofplayers) * 0.01 as DealtRake" Evaluate="DealtRake" />

<Stat ColumnName="Dealt Rake bb/100" ColumnHeader="Dealt Rake\nbb/100" ColumnFormat="0.00" ColumnWidth="*" Tooltip="Dealt Rake bb/100"
ValueExpressions="sum(pkh.rakeamount/1.0/gt.bigblind/pkh.numberofplayers) * 1.00 as DealtRake100" Evaluate="DealtRake100/totalhands*100" />

<Stat ColumnName="WTARake" ColumnHeader="WTARake" ColumnFormat="$0.00" ColumnWidth="*" Tooltip="WTARake2"
ValueExpressions="sum(case when ph.netamountwon > 0 then pkh.rakeamount else 0 end) * 0.01 as WTARake" Evaluate="WTARake" />

<Stat ColumnName="WTARake bb/100" ColumnHeader="WTARake\nbb/100" ColumnFormat="0.00" ColumnWidth="*" Tooltip="WTARakewat"
ValueExpressions="sum(case when ph.netamountwon > 0 then pkh.rakeamount/1.0/gt.bigblind else 0 end) * 1.00 as WTARake100" Evaluate="WTARake100/totalhands*100" />


Is there information about how ph.rakeamount is calculated somewhere? Also info about the stuff where you have to divide by 0.01 or 1.0?