Showing posts with label Betting Strategy. Show all posts
Showing posts with label Betting Strategy. Show all posts

Tuesday, August 5, 2014

Poker: cbet frequency

Below is a pretty rough look at how frequently you should c-bet.

In particular, I will look at an arbitrary scenario where you were the preflop opener and someone called behind you. It is easier to analyze than in position c-betting, since you have less information and must play more straightforwardly.

To keep it simple, lets say we opened UTG in full ring with the range detailed in the last post (77+, ATs/AQo+, KQs). The flop comes A92 rainbow. Then 40 of the 92 hands (ATs/AQo+) hit the A, 12 hands (AA and 99) flop a set, and the rest 40 combos are worse than top pair. Again following last post, bet sizing for OOP play on this sort of flop should be ~1/2x-3/4x pot.

Bet Sizings of 1/2 pot

Let's say we choose to standardize it at 1/2x. Then let's say we bet the 40 top pair hands, and try to check raise the sets. How many hands can we bluff? To make opponent indifferent to bluff-catching vs folding (ignoring subsequent streets for now), we bluff 1/3 of what we can value bet- 13 hands. This means that we would choose 77 and 88 to bluff with, and check only TT-KK and KQs.

So in this scenario, we are c-betting 56% of the time, and of the 44% we check, we are checking a set (13%) almost 1/3 of the time. Let's say someone bets half pot after we check. Suppose we checkraise all of our sets and we lay them 3:1 odds (ie. will match + raise half pot, or make the total pot size 3x initial flop pot). Then again, we should bluff 1/3 of the time that we check raise with a legit hand = 4 hands- we can bluff and play KQs like we play our sets for this round of betting. That is another 4% of our opening range.

So now we are left with the TT-KK (26%) that we checked. Maybe KK/QQ warrants one street of check calls depending on the bet sizes.

Let's assume that the opponent doesn't have anything. Then we (UTG opener) are taking down the pot ~75% of the time given this board. That sounds about right.

Bet Sizings of 3/4 pot

So let's say we choose to standardize our bets at 3/4 pot. Maybe we can be more conservative and check call with hands like AJs/ATs. Then we are betting 32 hands outright, and should bluff 32*3/7 = 14 hands. So 77, 88, and half the KQs.

You check raise the sets again, but size it to lay 7:3 odds. So then you can bluff 12*3/7 = 5 hands. Lets say 5 out of 6 TT.

So you are left with 23% of hands (JJ-KK, 2 KQs, 1 TT) that you might checkfold here, and another 9% of hands that you are probably check calling (ATs AJs). Of course, whether your check call or check fold these 32% of hands actually just depends on your opponent's bet size.

Bet Sizes and Clairvoyance

Also note that if we were more aggressive and bet AJs/ATs, then we could fit all the KQs into the bluffing range as well, and we are left with 20% (JJ-KK, 1TT) in our checking-call/fold range. This makes sense because the bigger the bet size the more the opponent will have to fold.

However, this requires clairvoyance- we are making the implicit assumption that AJs/ATs are good- when in fact they might be losing hands. By clairvoyance I mean knowing for sure that you are ahead while your opponent is not sure.

Clairvoyance tends to promote heavier betting to maximize EV by replacing parts of our checking range with our bluffing range. However, note that when we do bet, our EV is the same regardless of bet sizing.

For example, if you were deep stacked with the nuts and no hand can improve to beat it, you could bet 100x pot and bluff at close to the same frequency (100/101x nut frequency). Whenever your opponent is faced with this bet, he should theoretically call to bluff catch 1/101 of the time. Of all the hands that you jam, this allows you to take down ~99% of pots right away and showdown with just over 50% chance of having the nuts in a 202xinitial size pot the remaining 1% of time. Notice that even in the scenario where opponent bluff catches, you are expected to get 101.5x initial pot. In fact you expect to get 1.5x initial size when they call. So when you do jam, you get 99% * 1 + 1% * (101/202 * 202 - 100) = 1x initial size.

Compare this to betting only 1x pot. Then you can only bluff 1/2 of the time, and opponent bluff catches 1/2 of the time. So only 50% of pots are taken down right away and you are 2/3 chance of winning if they bluff catch. So the final payoff = 1/2 * 1 + 1/2 * (2/3 * 3 - 1) = 1x initial size.

We make the same amount either way when we bet because everyone is playing optimally. However, we can bet more frequently in the first case vs the second case. ie. Let's say our hand range gives us the nuts 40% of the time. Then if we can jam 100x pot, we can bluff another 39.5%, and say check fold the rest. ie. we get to take the jamming line and make 1x initial size 80% of the time. However, if we bet 1x pot, we only get to bet and make 1x initial size 60% of the time.

In fact, if our hand range was so strong that say we could value bet 67% of the range, then you will see that any bet sizing > 1x pot actually lets us bluff > 33% of our range. ie. we could bet 100% of the time. Once we get past this limit, it is especially profitable to jam. Let us redo the calculations above for expected profit. For any bet sizes up to 1x pot bet, you still make 1x initial size. But for 100x pot bet, you make 99% * 1 + 1% * (67% * 202 - 100) = 1.34x initial size. It turns out that if our range and effective stack size ever allow for a bet size that lets us bet 100% of the time, then jamming above that size potentially lets us make above average profits. In fact, the optimal solution for our opponent if they knew our range would be to fold 100% of the time (ie. they can never try to bluffcatch).

So why do people not jam all the time? As stated above, in practice, it is unclear whether you are ahead or not. A smaller bet size lowers the cost if you make such a mistake. Also, what if your opponent does not play optimally and makes mistakes in subsequent play? Then you may have a reason to give more room/space for them to make errors, instead of forcing them to take the easy correct path.

In real life, the hand that is behind may also have outs. Then, how much you bet is actually affected by how likely you are to get drawn out on. As discussed previously in, this can be calculated by considering pot odds and implied pot odds. In real life, you might not be sure which draw/how many outs your opponent has.

To be safe, you could try to price out the draw with the most outs. Theoretically, overbetting is not a big mistake since your opponent cannot take advantage of it immediately (vs if you underbet, opponent can call and you make < 1x initial size).  However, in practice you are again helping your opponent make the correct decision, and if you were wrong and you were in fact behind, then it will be very costly. So perhaps your should take the most common draw and size your bet according to that.

So it turns out that your bet sizing should be determined by the # of outs/how coordinated the board is, and that your action (value bet/bluff/check) frequency should be affected by your hand range. On a side note, if you needed to bluff catch, you would base your decision off of your opponent's range, not your own range.

Wednesday, June 18, 2014

Poker: An Overview

Hand Ranges

I was doing some house keeping the other day and decided to re-look at my hand ranges to open and raise in a 9 handed game:
  • UTG (7% for 2 opponents) 77+, ATs/AQo+, KQs
  • UTG+1 (10% for 2 opponents) 77+, A9s/AJo+,  KTs+/KQo, QJs
  • UTG+2 (14% for 2 opponents) 66+, A7s/ATo+, K9s/KJo+, QTs+, JTs
  • MP1 lowjack (20% for 2 opponents) 55+, A3s/A8o+, K7s/KTo+, Q9s+/QJo, JTs
  • MP2 highjack (25% for 1 opponent) 44+, Axs/A7o+/A5o, K6s/K9o+, Q9s/QTo+, JTs
  • cutoff (35% for 1 opponent) 33+, Ax, K3s/K7o+, Q6s/9o+, J8s+/JTo, T9s
  • dealer (50% for 1 opponent) 22+, Ax, Kx, Qxs/Q5o+, J5s/J8o+, T7s+/T9o, 98s
  • SB (50)
We can see this gives an attempt to steal of ~40-45% over the cutoff/dealer/SB positions. This sounds slightly high but still reasonable in online poker. Notice that our range is also skewed to play less OOP and more IP, because I just find it to be easier that way. This is in comparison to a "typical" opening range for UTG to SB: 12/14/16/19/24/31/45/60. ie. open UTG with 12% and hands, open UTG+1 with 14% of hands etc.

Using our opponent's "typical" opening range, we can calculate how frequently we will open: (7% + 0.88*10% + 0.88*0.86*14% + 0.88*0.86*0.84*20% + 0.88*0.86*0.84*0.81*25% + 0.88*0.86*0.84*0.81*0.76*35% + 0.88*0.86*0.84*0.81*0.76*0.69*50% + 0.88*0.86*0.84*0.81*0.76*0.69*0.55*50%) / 9 = (7% + 0.88*10% + 0.7568*14% + 0.6357*20% + 0.5149*25% + 0.3913*35% + 0.2700*50% + 0.1485*50%) / 9 = 8.8%

Now also consider the number of times that we 3bet. Roughly, we should 3bet if we are in the top half of the range of the raiser. Instead, let us approximate by saying we are going to 3bet/call raises with the top half of our own open raise range for that position (UTG+1 to dealer). From SB and BB, let's say we will play top 5% of range. Let us approximate our 3bet/call frequency as follows:
(0.12*5% + 0.25*7% + 0.36*10% + 0.49*14% + 0.6*20% + 0.73*25% + 0.85*5% + 0.95*5%) / 9 = 6%

This means we have a VP$IP of very roughly 14%-15%. Tracking my own statistics, I see that I have a VP$IP between 12%-20% each session, and PFR 10%-16%. This sounds roughly inline with what we looked at above (a bit looser) and points to a roughly 50/50 split between 3betting (3%) vs calling (3%) when facing a raise. Whereas previously, most of the calling came from set mining OOP because I was getting say 1:3 odds, I am working on reducing that and instead changing some IP 3bets into flat calling to limit pot sizing, especially against calling stations.

Bet Sizing

Preflop Bet Sizing
Whereas previously I have employed a 3bb bet sizing for late position steals, recently I am testing out a smaller size so the pot doesn't get too bloated. I've frequently had hands before where SPR gets so low that I am committed with mediocre hands.
  • 2bb for UTG, UTG+1, UTG+2
  • 2.5bb MP and LP
  • 3.5bb in SB
For 3bets, I tend to do a bit over half pot if IP and close to full pot if OOP.

Flop Cbet Sizing
Previously, I always ran into trouble betting 1x pot OOP because I would lose pots like overpairs/two pairs against sets or better. That itself is not an issue, but I would be way too committed to fold by the time the opponent showed enough strength/their hand range had clarified to the pt where I am behind/have < 50% equity. Hopefully, the smaller preflop bet sizing should help with the "Bayesian updating" before the pot gets too big. In a 3betted/4betted pot though, I might have to check-call more often on the flop/turn/river, or use 1/2x pot bet sizes.
  • OOP- usually 1x pot
  • IP- usually 1/2x pot
Adjustments:
  • adjust size up by 1.5x-2x of normal bet if flop is super wet
  • adjust down to 2/3-1/2x if the flop is super dry
However, I have not thought very deeply on how to incorporate probe bets into flop betting yet. Also, what % of flops should you cbet, and what % should you check raise/call/fold? Should your hand range or bet sizes change as the effective stack size changes? I hope to think about these points in another article.

Friday, August 30, 2013

Poker: Pot Odds 2

Some follow up thoughts on the first post about odds. To get the most precise numbers for your hand's equity/odds, you should compare pot odds with your hand's odds of hitting its outs.

So using the same scenario from the first post, the third/most precise method is as follows:

Method 3 == Pot Odds vs Odds of Hitting Outs
Pot odds == 1:5
Your hand has 8 outs. On the turn, there is 52 - 5 = 47 cards left. Your odds of hitting  outs is 8 : (47-8) == 8:39 == 1:4.875
Since pot odds > odds of hitting outs, you should call.

So note that this is much more precise, and only deals with the turn card (ie. if you had read the second post about bet sizing, this assumes that you will bet optimally on the turn again and that effective stack size is large enough for optimal bet)

However, the disadvantage of pot odds is that when the probability is small, the odds change very rapidly to any small change in probability. ie. 1:49 vs 1:99 is actually only 1% apart. So whereas for equity calculation, you are "safe" if you have say a 5% buffer between required equity vs hand equity, here there is no similar rule and you might be easily mislead as to how much edge you have.

Let's look at what a 5% equity edge means for different pot odds.

Bet SizePot OddsRequired # of Turn Outs Without BufferEquity + 5% BufferRequired Hand Odds With BufferRequired # of Turn Outs With Buffer
1/4x pot1:57.821.7%1:3.610.2
1/2x pot1:311.830.0%1:2.314.2
1x pot1:215.738.3%1:1.618.1
2x pot1:1.518.845%1:1.221.4

Without the 5% buffer, the Required Hand Odds should equal pot odds. Instead, as you can see, 1:5 -> 1:3.6, while 1:1.5 -> 1:1.2. Hence there is no easy way to build in some buffer with pot odds. However, you may have noticed that the required outs actually increases by a constant (2.4 outs) when you build in a 5% buffer. This makes perfect sense- 2.4 outs --> an extra 5% chance of drawing out.

Thus the optimal way to give yourself a buffer is to calculate the odds as is, but then require a couple extra outs to be conservative.

Interestingly, if you look at the # of outs required for 1x pot and 2x pot bets on the flop, they are actually "ahead" (> 50% chance of drawing out by the river). So it seems as though any drawing hand that could call a > pot sized bet could also just raise or push all-in. More on this next.

Wednesday, August 28, 2013

Poker: Bet Sizing

Following the last introductory post to poker, here is an example on how to determine bet sizing based on the texture of the flop.

Let's say effective stack size is 200 BB, we are in button/cutoff, it was limp/folded to us, and we raised to 4-6 BB and one player called. So the pot is ~10 BB (8.5-13.5 BB depending on dead money/size of raise) and effective stack size is 195 BB.

Let's say the flop comes with two flush cards (two cards of same suit) and you have top pair top kicker and you are committed to calling the all-in even if the another flush card comes because you have a weird hunch/you are tilting etc. Let's look at what you need to bet taking into account the implied pot to push a flush draw opponent out of the pot.

The flush draw opponent has 36% equity -> you want to lay 1.8:1 odds for optimal play -> with an implied pot of 10 BB + 195BB, that is a bet of 205/1.8 = 114 BB. This sounds ridiculously huge and incorrect. There are two reasons for this. 

  1. Being willing to commit 200 BB on a flush board with top pair is an incorrect play. 
  2. The existence of a turn bet means that the true "correct bet" amt is much lower. 
We will look at these two lines of thought below and examine what the "correct bet" should be if we take such factors into account..

How much you would typically/normally commit with top pair top kicker
Generally, with top pair or worse, you want to control the pot to be medium sized. Let's look at what that means for the flop/turn/river betting rounds:

  1. if betting sizes were pot sized, I would say two bets would already be really pushing it. (ie. you would control the size by either bet/check/bet or bet/bet/check etc). In this case the pot would be 90 BB by showdown and you and your opponent would have each put in another 40 BB.
  2. if betting sizes were 1/2 pot, it is probably feasible to bet on all three rounds. In this case the pot would just be 80 BB (35BB each since flop). But betting like this might be stupid with the flush draw on the board.

From these rough estimates, it seems that we should be willing to commit another 35-40 BB to this 10 BB pot. Let's say that the implied pot size is 10 + 35 BB. Then the optimal bet is 25BB, or 2.5x the pre-money pot. This certainly seems more reasonable but from what we know empirically about poker betting, it still seems to be on the high end. Let's move on to consider the fact that there can still be betting on the turn/river.

Betting on the turn

From the conclusion of last post, remember that by betting optimally against a dog, each time you bet, you are effectively causing them to loose money equivalent to them folding to the bet in the long run. I would thus make the following statement:

By betting optimally on the turn, it is as though we have cut off the opponent's chances to draw on the river. ie. it is as though the opponent loses the pot right here on the turn.

Now, we can see that perhaps our opponent doesn't have 36% equity, since after they see one card on the turn, we can bet again, which is equivalent to cutting them out right there. So they have 9 outs out of 47 possible turn cards. So we could lay 38:9 ~= 4.2:1 odds to price them out. With a 45BB implied pot, this means betting 10.7 BB ~= 1.1x the pre-money pot. This is more inline with what we know as "normal" betting. 

What is interesting is that if you follow this line of reasoning/betting on the flop, you are committed to betting the turn 100% of the time if no flush cards come out- otherwise you are actually giving your opponent 36% equity and good odds to call on the flop.

So it turns out that maybe our flop bet sizing could vary depending on our game plan on the turn.

As a matter of exercise, let's look at what our proper bet on the turn is. Let's say we just bet another 1x pot on the flop- so the turn pot is 30BB (and we are ready to commit another 25-30BB). What is the optimal bet on the turn if no flush cards come? They have 9 outs out of 46 river cards, so we lay 37:9 ~= 4.1:1 odds. With an implied pot of 60BB, this means that betting 15xBB = 1/2 the pre-money pot.

So either you bet [1.1x pot on flop AND 0.5x pot on turn], or maybe you need to overbet on the flop by betting (at most?) 2.5x pot if you intend to (sometimes? check the turn.

Friday, August 23, 2013

Poker: Intro to Pot Odds

Here's some useful background for anyone interested in poker. Frequently, when someone bets into you, and you are chasing a draw, you need to decide if you want to call or not. Below, we look at a couple ways to think about this.

Before we start, one important definition to get out of the way. The term equity/pot equity may be confusingly used to refer to a % of the pot or an actual $ amount. I will use %equity and $equity to differentiate between these. Both %equity and $equity look at what would happen on average if your hand was taken to show down without any further betting.

Take an example on the turn where the pot is $100. then the opponent bets $25 into pot. We need to decide if we call or not. 

Simple Pot Odds
We are doing the analysis below with the assumption that opponent is all-in (or that there is no more betting on the river). Intuitively, we might already think that it is cheap to call (we can call because the bet was small)- let's see what the math says:

Method 1 == pot odds required probability vs %equity

Pot Odds
  • the opponent just bet 1/4 of the pot.
  • the pot odds that you are getting is 25:125 == 1:5
  • ie. pot odds are post money (inclusive of bet)
  • from the pot odds, the required equity (probability of winning) in order to call is 1/(5+1) = 1/6 = 17%
%Equity (== Your Hand's Actual Probability to Win)
  • looking at your hand vs your opponent's range, what is your probability of winning?
  • let's say you put your opponent on a pair or better and you just have a straight draw.
  • you only win if u hit your draw (8 outs = 18% chance of hitting)
Now compare pot odds probability (17%) to your hand's probability to win (18%) and since hand probability > the probability required from pot odds, this is callable. (maybe in practice you might demand say a 5% buffer before saying it's callable?)

Method 2 == EV calculation
folding = $0 
calling = 18% * 125 + 82% * (-25) = $2
so it's +EV to call. so call
Notice that here, you already take into acct the pot size (125) and the bet size (25).
Compare this to method 1 (the pot odds vs probability method) - the probability calculation doesn't take into acct the bet/pot ratio and that's why you need to compare pot odds to it in method 1.

I think in practice, method 1 is actually easier to work out over the board.


Implied Pot Odds

Now let's say we were not allin (there is more betting on the river). Let's say there's another $50 behind in effective stack size after the call. it's actually very easy to do implied pot odds
25:(125+50) == 1:7
that's it. required equity is 12.5%.
no chg with hand equity. so 12.5% vs 18% == much bigger reason to call/you have much more juice

Looking at the EV method, this is 18% * 175 + 82% * (-25) = $11




Benefits of Offering the Correct Odds

On a side note, i think it is interesting to look at what the EV # means. One way to think about the expected value of your profit at each situation is your $equity - money put in. At each point of decision when you have to decide between raise/bet/call/check/fold, you are seeking to maximize your incremental profit.

Let's go through the scenario above where you and your opponent each put in $50 before the turn, and have $25 each left. At the beginning of the turn, your $equity is $18, so your accumulated profit since the start of the hand is $18 - $50 = -$32.
  1. if you could check it down (opponent hadn't bet) == you would get avg $18 from the pot of $100. Your incremental profit in this scenario is $0. Your accumulated profit since the start of the hand is still -$32.
  2. Opponent bets and you fold. You $equity dropped to $0 here from $18, and you also didn't put any more money in. So your incremental profit for choosing this option is -$18. Your accumulated profit is now -$32 - $18 = -$50.
  3. Opponent bets and you call $25 allin. You would get avg 18%*150 = $27 from the $150 pot. Your $equity increased from $18 to $27, but you also spent $25 calling. Your incremental profit = +$9 -$25 = -$16. Add this to your pre-calling accum profit of -$32 before to see that your post-calling accum profit is -$48.
Note that if you could, you would still much rather get option #1 than having to choose between #2 and #3. In option #3, your are choosing an action that has -EV (you lose another $16). However, choosing option #2 would have even worse consequences (-$18). All this is because your opponent had bet out at you when you had <50% in %equity. You either put in more chips being the underdog, or you fold- effectively losing your pot equity (the chance to draw out on the winner).

This has very interesting implications for when you are playing/betting optimally with the winning hand. 

By making an optimal bet, you win exactly your opponent's $equity since they should be apathetic to folding.

Quick example to show this again: lets say your opponent still has 20% chance (one in five) to draw out on you in a $100 implied pre-money pot. Right now, your accum profit is 80 - 50 = $30. Optimally, you would lay 1:4 odds post-money, or 1/3 of the pre-money pot == $33. If we show that when you make this $33 bet, you are increasing your accum profit from $30 to $50, then we have shown a working example of the statement made above. It is obvious if opponent folds. If opponent calls, then your expected payoff is 80% * 166 = 133 and your cost is 50 + 33 = 83. Accum profit = 133 - 83 = 50. 

Note that this optimal bet sizing is most important to get right when it comes to closer draws (ie. it matter less when you are 90/10 favorite already). I claim this because with a close draw (say 60/40), the opponent still has 40% equity in the pot, so betting correctly to win that 40% equity is likely to be hugely lucrative, vs winning the 10% equity is less so. This may be a reason for why we have more freedom to slow play with trips etc when we are already 90%+ favorites.

Monday, January 14, 2013

Betting/trading strategies- Sizing

One of the mysteries facing finance professionals is how to reconcile the quantitative with the qualitative/discretionary. I actually think most gambling professionals do this quite well (eg. bet sizing on poker)- this may be because the risk/reward is much more well-defined (vs investing). I would like to propose a system to conduct position sizing that integrates the qualitative with the quantitative.


this is dependent on 3 things. 

(1) how risky the thing is on a daily basis (ie. can go up/down by $1 vs $100)
(2) how much conviction you have (ie. i would do something like, 3 conviction levels, lowest = believe can get 5% Return on Risk, mid = 10%, high = 20%)
(3) what is your intended time horizon (or alternative way to say this is take profit/stop loss level)

Then (4) plug into kelly's criterion and take 1/2 kelly as position size

So taking aapl as an example:
(1) daily range is say $15
(2) say you have high conviction (ie. you believe you can make $0.2 vs every $1 you risk, as an average of many bets with this level of conviction. this could mean you make $1.2 half the time vs lose $1 half the time, or that 60% of the time you make $1, and 40% of time you lose $1). I think these conviction levels make sense. 5% = any lower and you should definitely just put it in cash/ST bonds. 20% = anything higher and this is a once in a lifetime/decade type trade, where you really just plunge as much as possible (and sizing is to make sure you can maintain exposure in face of MTM losses)
(3) let's say your intended time horizon is 1yr. then yearly vol is $15 *sqrt(252) ~= 240. this sounds about right (eg; this yr aapl range was from 380-700) 
(4) so every share of aapl (550), you may make +290 (240*1.2) vs lose -240. kelly's = EV/win = 50/290 = 0.17. which means that you should risk 17% of your portfolio.
taking half kelly to be conservative, that is 8.5% of portfolio. which means amt of AAPL shares to buy = your total portfolio value * 8.5% / 240

so eg: on 1mil portfolio, you should buy 355 shares of aapl (195k) if you intended to hold it for 1yr+ and have medium conviction on it. this is about 20% of your portfolio, which is very aggressive sizing already. for long/short equity, anything 10%+ would be considered concentrated. the reason why it is high here is because you have super high conviction assumptions. 


note that
(1) we havn't looked at portfolio correlation yet, which would involve dialing down sizing if you have similar exposures.
(2) this # that we got is the MAX risk you should ever take. ie. anything more is theoretically bad for you (ie. your LT returns will be lower than if you just took less risk). so depending on how risk averse you are, you should be sizing significantly less than kelly. (eg: you could always size 1/4 kelly)
(3) can play around with the skew/kurtosis of returns to get a different sizing. In fact, all the steps above are actually asking you to describe a probability distribution of your return for this trade. (1) is asking for stdev, (2) is asking for mean, (3) is looking at how returns scale with time (is there autocorrelation?) which is also going to be related to kurtosis in this case (+ve autocorrelation = higher kurtosis compared to standard assumptions when scaled up with time) (4) is asking about the skew (are you 50% to win 1.2 and 50% to lose $1, or are you 60% to make $1 and 40% to lose $1)

Wednesday, October 24, 2012

Betting/trading strategies- Chunking

X%- a concept to unify different betting strategies
Following last post, a similar trading cousin for the Martingale gambling strategy is the sit and wait strategy (buy and hold with no stop losses and exit when you reach a predefined take profit level). This trading strategy is similar to the gambling strategy in the sense that both depend on the market/game to eventually do something (if I wait for long enough/try enough times it will eventually happen and I will be profitable overall). Sit and wait is like a more conservative version of Martingale. Lets say for the Martingale, instead of doubling down each time you lose, you increase your bet by x%. For example, x could be 200% (triple down) or 0% (sit and wait for casino bets). The stock market equivalent is re-balancing and increasing your original exposure by x%. (ie. let's say you had invested $100 in stock, it goes to $75. For Martingale strategy you invest another $125 to make it 2x original exposure = $200) This rebalancing assumes you are still under the same return distribution situation.

As we increase x, we are more likely to win/get back to breakeven when we are losing. For example, let's say we just lost k in a row. For doubling down on a 50/50 bet, we are 50% likely to get back to winning $1 overall by the next turn, but for sit and wait, we are only (1/2)^k likely to get back to breakeven.

At the same time, our losses increase at an exponential rate (1+x%) if we keep losing. This creates an embarrassing problem- how do you avoid bankruptcy if your losses increase exponentially? This goes back to the "chunking" mentioned in the first post. In trading this would be how much extra margin/loss buffer should you budget for this trade before it starts to win. And if you are going to double down/add, at what point should you do this? ie. if you go bankrupt/can't take the pain/extreme exposure after the third time you are wrong, then you need to split the potential worst case scenario into 3 segments and add as you cross between segments. In general you would split these segments by P&L, but it could also be possible to split it by underlying price movements, or even time or a function of all of the above. In the case of the stock mkt, it is also meaningful to vary x as a function of the underlying stock price movement, p&l change, time and other parameters.

Chunking- trade planning/margin budgeting
Let's derive the formula for how to chunk. For gambling, this is relatively easy. You lose b, b*(1+x), b*(1+x)^2,...,b*(1+x)^(n-1) So our total loss is a geometric series and equal to b*[(1+x)^n-1]/x. So given n (how many times you lose before you bankrupt) and x (the double down amt), you can calculate how big your bankroll has to be relative to bet size b:  bankroll is [(1+x)^n-1]/x times that of bet size b. For example, if x = 100% (martingale; doubling down each time), n = 10 (will go bankrupt if wrong 10 times in a row), you need 2^10 - 1 = 1023x initial bet.

It is however more complicated for trading, since you don't lose everything that you bet. Let's define a set {p_0, p_1...p_n} to stand for the stock price at which we would dial up our exposure another 1+x. We could have the set be in arithmetic progression (eg: keep adding per every $1 price drop), or it could be a function of P&L (eg: keep adding per every $100 loss), or time (eg: keep adding every 1min- here we would not be able to predict what p_i is before time t).

Let's start with the common “Martingale-like” case where p_i is an arithmetic sequence, we have a defined stop loss pt p_sl determined by the stock price terms (not P&L), and we rebalance by doubling the # of shares that you own each time. Then p_i = p_0 + (p_sl - p_0) * i / n. And the shares you buy each time b_i = b_0 * 2**i. (note ** means exponential).
Your worst loss is sum[b_i * (p_sl - p_i)] where i is the set of integers from 0 to n-1. Courtesy ofWolfram Alpha, we see:

Since m = n-1, this simplifies to b_0 * (p_sl - p_0) * [2**(n+1) / n - 1 - 2/n]. So let's say you had 1 mil budgeted to buy this stock, and you wanted to bet 4x before you go bankrupt, and you expect p_sl - p_0 = 100-70 = $30. Then we can look at how much (# of shares) to bet initially if we want to be able to rebuy n times.

We can also create a table showing how the intial bet size (both in terms of shares- b_0 and also as a % of total risk budgeted/worst case loss) increases with n.

Initial Bet
NShares% of Budget
133,333333%
216,667167%
39,09191%
45,12851%
52,92429%
61,66717%
79459%
85315.3%
92963.0%
101641.6%

Note that, for example, for n = 1 (just bet once and don't redouble ever), then you would be buying stocks with a notional amt that is 3x your risk budget. Notice that this does not necessarily mean that you are "taking on leverage"- for example, if you had 10mil, and budgeted 1mil for this trade, and so bought ~3mil, then you are not going over your total account equity. The traditional concept of "leverage" is insufficient to describe your trades/risk levels when it comes to more complicated trading strategies.

A more useful version for trading is perhaps this:

Initial RiskLoss
N(as % of budget)Multiplier
1100%1x
250%2x
327%4x
415%7x
58.8%11x
65.0%20x
72.8%35x
81.6%63x
90.9%113x
100.5%204x

And then to get how much notional to invest, you simply divide this percentage by the worst case scenario return. eg: N = 2, worst case is -25%, then you should buy notional amt of 0.50 / 0.25 = 2x that of risk allocation initially. The loss multiplier is simply the inverse of the risk %. You can also use this to figure out what your max loss will be if you bought some amt and you are not sure how many times you will redouble:

eg: you bought 100 shares, and prices went from 120 to 110. You have been redoubling every $5 (so this will your third buy). If you are wrong again, then by 105, your total loss will be 1 / 0.27 * (100 * 15) = 5.5k. Let's check this:

PriceSharesLoss
120100-1500
115200-2000
110400-2000
Current Price105
Total Loss-5500

So this checks out.

Food for Thought- Thinking about Risk
This x% concept can be thought of as a trading style/bias. People who trade by x% (ie. doubling down on losses and taking profits vs cutting losses and adding to winners) are essentially trying to convert a payoff distribution that is linear to stock prices (ie. if stock goes up $1, you make b, if stock goes down $1, you lose b, where b = # of shares), to a distribution that is non-linear and path dependent. It is more complicated to understand and incorporate the risks involved with this sort of dynamic trading strategy when you are evaluating your portfolio's risk characteristics. You might realize that what I described is very similar to a description of options. There are interesting ways to integrating traditional methods of looking at options risk and concepts presented here (eg: chunking and taking into account your trading style):

(1) Bringing options concepts to x%. Your trading style (especially in the extreme case where you preset limit/stoploss orders religiously) can essentially be converted into discretized chunks of gamma. Using this, you can do standard risk analytics taking into account your intended future trades (eg: the increased tail risk? the expected theta?). Another possibility is to use x% as a way to normalize for some portfolio measures. eg- if you use a high +x% for this bucket of trades, then you would expect high success rates and probably equal-ish avg profit vs avg loss but also significant long tail losses. In fact, you could also back out an implied x% from your success rates or your avg profit vs avg loss.

(2) Bringing risk budgeting to portfolio analytics on derivative positions. One problem with current scenario analysis and stress testing techniques is that they is usually purely based on past data, and that they are used as a control- ie. someone/some software will give us this number and let's just keep our losses under this threshold. One thing to do is to be more logical when it comes to estimating the risk budget/max loss. For example, we developed a formula for max loss (given n) above. I believe that a model based on fundamental characteristics (eg- for stocks this could be using a P/E range to derive a max loss) could be an interesting supplement to standard risk models nowadays. Unfortunately, traditionally, the risk manager is not involved in the investment research process and so lacks the in-depth fundamental knowledge required to create such a model.

Monday, August 13, 2012

Betting/trading strategies- Martingale

Introduction to betting strategies
Something I have been thinking about recently has to do with different trading/betting systems. I'll probably be doing a series of blog posts on this. Let me first define what I mean by a trading/betting strategy- this is a set of rules that dictate what you should do next based on your prior streak of wins/losses and your present P&L in the game (eg: gambling game, stock market...). The goal of this strategy may be to make money, but may also be to minimize variance (risk), avoid losing too much on money that has already been laid on the table (ie. successfully exiting losing positions), or to exploit a certain effect (eg: mean reversion, autocorrelation)...

For background, look at these 3 strategies:
Martingale is generally considered fatally flawed; daily re-balancing is a hot topic right now in finance (I'll explain more later); and Kelly's is actually a mathematically proven betting strategy.

In this post I will examine Martingale and a close cousin of it (trading version) and return to other strategies in later posts.

Mathematics behind the Martingale strategy
The Martingale basically says this: bet $1. if you lose, double down. if you lose again, double down again. So  you are "guaranteed" to win $1 at the end (unless you just keep losing ad infinitum). The major problem with this is that you only have a limited bankroll. eg: say after you've lost 10x in a row, you may be out of money and the casino/brokerage firm won't let you double down anymore (because you won't be able to pay if you lose again) At this point, you are close to bankrupt and you can't double down to recoup your losses anymore.

So the hidden downside is actually that you might go bankrupt before you win once. So the question is actually what is the probability that you would go bankrupt? Let's say in a 50/50 game you budget 1023x the initial bet (ie. you could lose 10 times and then be bankrupt). Then the chance of you going bankrupt per attempt to win $1 is around 0.1% (precisely 1/1024). Now let's look at the probability that you will go bankrupt as a function of how many times you attempt:



Note that while the curve (first graph) is bounded by 1, initially (say first 100 attempts- second graph), your chance of bankruptcy is almost linear to your # of attempts n. This is because Pr(bankruptcy) = 1-(1023/1024)^n  = 1 - (1 - 1/1024)^n ≃ 1 - (1 + n/1024)  = n/1024. This result is from first order Taylor series approximation (given small enough x = 1/1024 around the point a =1)

So for example, if you plan to attempt to win $500 (try 500 times), there is a 1-(1023/1024)^500 = 38.6% chance that you will "go bankrupt' before you reach 500 (ie. lose $1023- notice that you would still have the $499 or however much you collected before you go bankrupt). If you did go bankrupt before you reach 500, on average you would have gone bankrupt on attempt #230 (you get this by doing sum[Pr(n) * n] / sum[Pr(n)]. where Pr(n) = Pr(bankrupt on n-th turn) = (1023/1024)^(n-1) * (1/1024). I just summed this over excel- is there another way to do this?)

Soooo. let's see if this all makes sense.
EV = 38.65% * (-1023+230.2) + 61.35% * (+500) = 0

Betting strategies = transform your return distribution
So as you can see, by following the Martingale betting strategy and stopping at 500 wins, we can actually consider this whole strategy as one single bet of [win $500 with 61% probability or lose $793 with 39% probability], which is still 0 EV. ie. We have not gone anywhere from the original single bet of [win $1 with 1023/1024 probability or lose $1023 with 1/1024 probability] which is also 0 EV. Essentially the betting strategy has allowed us to change the distribution of returns while keeping your expected profit (EV) the same. This is an interesting topic that we will revisit later (probably when we talk about Kelly's criterion).

The interesting thing about this is that you can "see" your P&L progress over time. ie. instead of one single bet where you have 0 info about if you are going to win or not and that becomes 100% certain right after the dice roll, here, as you make successful attempts, you are slowly but surely moving towards the +$500 outcome (instead of the -$800 outcome. ie. the odds are slowly tilting in favor of you. One significant difference between gambling and trading is that trading is more continuous. ie. even though your trades are discrete, the market price changes rather continuously during trading hours. This is similar to what is happening here where you can see your P&L slowly accumulate before you finally exit the trade.

In trading, I would would look at this strategy as having positive theta (ie. as time passes, you start to make money). In this case, the reason why there exists positive theta is because you are taking extra risks on every iteration/bet/time period. Here, the risk you are taking is the 1/1024 chance that you lose 1023. When these risks are not realized, you make money. This is the case for say short gamma positions in trading. Short gamma positions basically mean that large price movements are bad for you. (vs long gamma positions ie. the people betting against you are betting on large price movements) So every second/minute/hour/day (remember trading is more continuous) that there is no large price movements materializing, these mini bets for large price movements are expiring worthless for the long gamma guy and you are making money because you have lived to fight another day/minute/second.

Further topics (to be discussed next)
So strats like these are highly dependent on budgeting. On a totally unrelated note, in poker, there's this concept called chunking- basically say you expect 3 more rounds of betting till showdown. Then you size up your opponent's (assuming he has less chips than you) stacks and figure out how to size the bets to get him all-in at the third bet. So for example, in a $15 pot right  now and your opponent having $100 stack left, you would say bet $15, $30, $60. The bets scale up every time because the pot has gotten larger. You for a small pot, it might turn out that you need 4 bets to be all-in- in which case you need some action (ie. a raise) to be able to go all-in. But the point of this discussion is that you need to do the same thing when you are budgeting for Martingale betting. ie. if I am going to bet 1,2,4,8,16 then give up, then I need to budget $31. And this $31 hopefully lasts me for the craziest price swings ever. ie. Let's say AAPL trades in $10 range 60% of time, $30 range 90% of time, and $50 range 99% of time. You should be betting say $1 for a $5 deviation from the median (whatever that means), $2 for a $10 deviation, $4 for a $15 deviation, $8 for a $25 deviation, and really really hold tight before you make your $16 bet at the end. ie. at what pt you double down is highly dependent on how rare of an outcome this pt is.

ok- back to martingale and its cousin trading strategy. The cousin trading strategy that I wanted to talk about was the following:

Buy the stock. Set take profit level at say +10%. If stock trades down, sit and wait. If it keeps trading down, sit and wait more. Since variance increases with time and is not bounded, this means that eventually stock will trade to +10% and you can exit at a profit. So this is similar to the Martingale in some respects. What I mean is this:


If you look at the chart above, the range of estimates for the stock increases the further you go into the futures. This is in part because the stock is expected to trade in a bigger and bigger range given longer and longer time periods. This means that it is easier for you to reach any pre-set level as time goes on, potentially even if the drift (general trend) of the stock is downwards (ie. the opposite direction to your bet).

This post is getting pretty long, so I'm actually going to talk about this strat more in the next post before going on to other strats. In the mean time, key thoughts about this strat:

It is also highly dependent on the return distribution. Need to compare how much increased variance over time contributes to probability of hitting target take profit level  (eg: 50% chance of touching x in y days, -> 50% chance of touching sqrt(2)x in 2y days) to "breakeven drag". ie. how much stock will have to trend down for you to have deteriorating chances of hitting target level (have negative theta).