The Formula That Helped Me Get Into in the Top 2% of TradersI spent years testing different strategies, obsessing over charts, and trying to find the perfect entry point. It took me a while to realize that it wasn’t just about picking the right trades—it was about knowing how much to risk on each trade. This is where the Kelly Criterion came into play and changed my entire approach.
You’ve probably heard the saying, “Don’t put all your eggs in one basket.” Well, Kelly Criterion takes that idea and puts some hard math behind it to tell you exactly how much you should risk to maximize your long-term growth. It’s not a guessing game anymore—it’s math, and math doesn’t lie.
What is Kelly Criterion?
The Kelly Criterion is a formula that helps you figure out the optimal size of your trades based on your past win rate and the average size of your wins compared to your losses. It’s designed to find the perfect balance between being aggressive enough to grow your account but cautious enough to protect it from major drawdowns.
F = W - (1 - W) / R
F is the fraction of your account you should risk.
W is your win rate (how often you win).
R is your risk/reward ratio (the average win relative to the average loss).
Let’s break it down.
How It Works
Let’s say you have a strategy that wins 60% of the time (W = 0.6), and your average win is 2x the size of your average loss (R = 2). Plugging those numbers into the formula, you’d get:
F = 0.6 - (1 - 0.6) / 2
F = 0.6 - 0.4 / 2
F = 0.6 - 0.2 = 0.4
So, according to Kelly, you should risk 40% of your account on each trade. Now, 40% might seem like a lot, but this is just the theoretical maximum for optimal growth.
The thing about using the full Kelly Criterion is that it’s aggressive. A 40% recommended risk allocation, for example, can be intense and lead to significant drawdowns, which is why many traders use half-Kelly, quarter-Kelly or other adjustments to manage risk. It’s a way to tone down the aggressiveness while still using the principle behind the formula.
Personally, I don’t just take Kelly at face value—I factor in both the sample size (which affects the confidence level) and my max allowed drawdown when deciding how much risk to take per trade. If the law of large numbers tells us we need a good sample size to align results with expectations, then I want to make sure my risk management accounts for that.
Let’s say, for instance, my confidence level is 95% (which is 0.95 in probability terms), and I don’t want to allow my account to draw down more than 10%. We can modify the Kelly Criterion like this:
𝑓 = ( ( 𝑊 − 𝐿 ) / 𝐵 )× confidence level × max allowed drawdown
Where:
𝑊 = W is your win probability,
𝐿 = L is your loss probability, and
𝐵 = B is your risk-reward ratio.
Let’s run this with actual numbers:
Suppose your win probability is 60% (0.6), loss probability is 40% (0.4), and your risk-reward ratio is still 2:1. Using the same approach where the confidence level is 95% and the max allowed drawdown is 10%, the calculation would look like this:
This gives us a risk percentage of 0.95% for each trade. So, according to this adjusted Kelly Criterion, based on a 60% win rate and your parameters, you should be risking just under 1% per trade.
This shows how adding the confidence level and max drawdown into the mix helps control your risk in a more conservative and tailored way, making the formula much more usable for practical trading instead of over-leveraging.
Why It’s Powerful
Kelly Criterion gives you a clear, mathematically backed way to avoid overbetting on any single trade, which is a common mistake traders make—especially when they’re chasing losses or getting overconfident after a win streak.
When I started applying this formula, I realized I had been risking too much on bad setups and too little on the good ones. I wasn’t optimizing my growth. Once I dialed in my risk based on the Kelly Criterion, I started seeing consistent growth that got me in the top 2% of traders on TradingView leap competition.
Kelly in Action
The first time I truly saw Kelly in action was during a winning streak. Before I understood this formula, I’d probably have gotten greedy and over-leveraged, risking blowing up my account. But with Kelly, I knew exactly how much to risk each time, so I could confidently scale up while still protecting my downside.
Likewise, during losing streaks, Kelly kept me grounded. Instead of trying to "make it back" quickly by betting more, the formula told me to stay consistent and let the odds play out over time. This discipline was key in staying profitable and avoiding big emotional trades.
Practical Use for Traders
You don’t have to be a math genius to use the Kelly Criterion. It’s about taking control of your risk in a structured way, rather than letting emotions guide your decisions. Whether you’re new to trading or have been in the game for years, this formula can be a game-changer if applied correctly.
Final Thoughts
At the end of the day, trading isn’t just about making the right calls—it’s about managing your risks wisely. The Kelly Criterion gives you a clear path to do just that. By understanding how much to risk based on your win rate and risk/reward ratio, you’re not just gambling—you’re playing a game with a serious edge.
So, whether you’re in a winning streak or facing some tough losses, keep your cool. Let the Kelly formula take care of your risk calculation.
If you haven’t started using the Kelly Criterion yet, now’s the time to dive in. Calculate your win rate, figure out your risk/reward ratio, and start applying it.
You’ll protect your account while setting yourself up for long-term profitability.
Trust me, this is the kind of math that can change the game for you.
Bonus: Custom Kelly Criterion Function in Pine Script
If you’re ready to take your trading to the next level, here’s a little bonus for you!
I’ve put together a custom Pine Script function that calculates the optimal risk percentage based on the Kelly Criterion.
You can easily enter the variables to fit your trading strategy.
// @description Calculates the optimal risk percentage using the Kelly Criterion.
// @function kellyCriterion: Computes the risk per trade based on win rate, loss rate, average win/loss, confidence level, and maximum drawdown.
// @param winRate (float) The probability of winning trades (0-1).
// @param lossRate (float) The probability of losing trades (0-1).
// @param avgWin (float) The average win size in risk units.
// @param avgLoss (float) The average loss size in risk units.
// @param confidenceLevel (float) Desired confidence level (0-1).
// @param maxDrawdown (float) Maximum allowed drawdown (0-1).
// @returns (float) The calculated risk percentage for each trade.
kellyCriterion(winRate, lossRate, avgWin, avgLoss, confidenceLevel, maxDrawdown) =>
// Calculate Kelly Fraction: Theoretical fraction of the bankroll to risk
kellyFraction = (winRate - lossRate) / (avgWin / avgLoss)
// Adjust the risk based on confidence level and maximum drawdown
adjustedRisk = (kellyFraction * confidenceLevel * maxDrawdown)
// Return the adjusted risk percentage
adjustedRisk
Use this function to implement the Kelly Criterion directly into your trading setup. Adjust the inputs to see how your risk percentage changes based on your trading performance!
Kellycriterion
Kelly Criterion and other common position-sizing methodsWhat is position sizing & why is it important?
Position size refers to the amount of risk - money, contracts, equity, etc. - that a trader uses when entering a position on the financial market.
We assume, for ease, that traders expect a 100% profit or loss as a result of the profit lost.
Common ways to size positions are:
Using a set amount of capital per trade . A trader enters with $100 for example, every time. This means that no matter what the position is, the maximum risk of it will be that set capital.
It is the most straight-forward way to size positions, and it aims at producing linear growth in their portfolio.
Using a set amount of contracts per trade . A trader enters with 1 contract of the given asset per trade. When trading Bitcoin, for example, this would mean 1 contract is equal to 1 Bitcoin.
This approach can be tricky to backtest and analyse, since the contract’s dollar value changes over time. A trade that has been placed at a given time when the dollar price is high may show as a bigger win or loss, and a trade at a time when the dollar price of the contract is less, can be shown as a smaller win or loss.
Percentage of total equity - this method is used by traders who decide to enter with a given percentage of their total equity on each position.
It is commonly used in an attempt to achieve ‘exponential growth’ of the portfolio size.
However, the following fictional scenario will show how luck plays a major role in the outcome of such a sizing method.
Let’s assume that the trader has chosen to enter with 50% of their total capital per position.
This would mean that with an equity of $1000, a trader would enter with $500 the first time.
This could lead to two situations for the first trade:
- The position is profitable, and the total equity now is $1500
- The position is losing, and the total equity now is $500.
When we look at these two cases, we can then go deeper into the trading process, looking at the second and third positions they enter.
If the first trade is losing, and we assume that the second two are winning:
a) 500 * 0.5 = 250 entry, total capital when profitable is 750
b) 750 * 0.5 = 375 entry, total capital when profitable is $1125
On the other hand, If the first trade is winning, and we assume that the second two are winning too:
a) 1500 * 0.5 = 750 entry, total capital when profitable is $2250
b) 2250 * 0.5 = 1125 entry, total capital when profitable is $3375
Let’s recap: The trader enters with 50% of the capital and, based on the outcome of the first trade, even if the following two trades are profitable, the difference between the final equity is:
a) First trade lost: $1125
b) First trade won: $3375
This extreme difference of $2250 comes from the single first trade, and whether it’s profitable or not. This goes to show that luck is extremely important when trading with percentage of equity, since that first trade can go any way.
Traders often do not take into account the luck factor that they need to have to reach exponential growth . This leads to very unrealistic expectations of performance of their trading strategy.
What is the Kelly Criterion?
The percentage of equity strategy, as we saw, is dependent on luck and is very tricky. The Kelly Criterion builds on top of that method, however it takes into account factors of the trader’s strategy and historical performance to create a new way of sizing positions.
This mathematical formula is employed by investors seeking to enhance their capital growth objectives. It presupposes that investors are willing to reinvest their profits and expose them to potential risks in subsequent trades. The primary aim of this formula is to ascertain the optimal allocation of capital for each individual trade.
The Kelly criterion encompasses two pivotal components:
Winning Probability Factor (W) : This factor represents the likelihood of a trade yielding a positive return. In the context of TradingView strategies, this refers to the Percent Profitable.
Win/Loss Ratio (R) : This ratio is calculated by the maximum winning potential divided by the maximum loss potential. It could be taken as the Take Profit / Stop-Loss ratio. It can also be taken as the Largest Winning Trade / Largest Losing Trade ratio from the backtesting tab.
The outcome of this formula furnishes investors with guidance on the proportion of their total capital to allocate to each investment endeavour.
Commonly referred to as the Kelly strategy, Kelly formula, or Kelly bet, the formula can be expressed as follows:
Kelly % = W - (1 - W) / R
Where:
Kelly % = Percent of equity that the trader should put in a single trade
W = Winning Probability Factor
R = Win/Loss Ratio
This Kelly % is the suggested percentage of equity a trader should put into their position, based on this sizing formula. With the change of Winning Probability and Win/Loss ratio, traders are able to re-apply the formula to adjust their position size.
Let’s see an example of this formula.
Let’s assume our Win/Loss Ration (R) is the Ratio Avg Win / Avg Loss from the TradingView backtesting statistics. Let’s say the Win/Loss ratio is 0.965.
Also, let’s assume that the Winning Probability Factor is the Percent Profitable statistics from TradingView’s backtesting window. Let’s assume that it is 70%.
With this data, our Kelly % would be:
Kelly % = 0.7 - (1 - 0.7) / 0.965 = 0.38912 = 38.9%
Therefore, based on this fictional example, the trader should allocate around 38.9% of their equity and not more, in order to have an optimal position size according to the Kelly Criterion.
The Kelly formula, in essence, aims to answer the question of “What percent of my equity should I use in a trade, so that it will be optimal”. While any method it is not perfect, it is widely used in the industry as a way to more accurately size positions that use percent of equity for entries.
Caution disclaimer
Although adherents of the Kelly Criterion may choose to apply the formula in its conventional manner, it is essential to acknowledge the potential downsides associated with allocating an excessively substantial portion of one's portfolio into a solitary asset. In the pursuit of diversification, investors would be prudent to exercise caution when considering investments that surpass 20% of their overall equity, even if the Kelly Criterion advocates a more substantial allocation.
Source about information on Kelly Criterion
www.investopedia.com
Kelly Criterion: Why YOLO Trading FailsThe Kelly Criterion is a formula that calculates the optimal bet size based on known probabilities that maximizes gains while minimizing ruin... or not getting “rekt” .
When we read social media and see infographics of "if you had just invested all your money into THIS you'd have THAT MUCH" it is tempting to dream about how rich we could be just betting BIG . Unfortunately in the real world statistics tell us that this is rarely the truth. However, statistics can tell us what we should do...