You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Need to change like below to calcuate it for investment scenario which allows partial losses.
defkelly_criterion(returns, prepare_returns=True):
""" Calculates the recommended maximum amount of capital that should be allocated to the given strategy, based on the Kelly Criterion (http://en.wikipedia.org/wiki/Kelly_criterion) """ifprepare_returns:
returns=_utils._prepare_returns(returns)
win_avg=avg_win(returns)
lose_avg=-avg_lose(returns)
win_prob=win_rate(returns)
lose_prob=1-win_probreturnwin_prob/lose_avg-lose_prob/win_avg
The text was updated successfully, but these errors were encountered:
According to https://en.wikipedia.org/wiki/Kelly_criterion,
current code is for a gambling scenario where you lose all your money when you lose.
quantstats/quantstats/stats.py
Lines 870 to 882 in fa0a91a
Need to change like below to calcuate it for investment scenario which allows partial losses.
The text was updated successfully, but these errors were encountered: