I think your model is wrong. If you don't get profit with A% with probability w, that doesn't mean you always lost B% with 1- w.
So, the model should be modified like this
k is Kell %,
1^(1 - w - w')n means the current HYP is between kr and ks, we holding.
w and w' are win and loss probability
F = (1 + kr)^wn * (1 - ks)^w'n * 1^(1 - w - w')n
log(F) = wn * log(1 + kr ) + w'n * log(1 - ks) + 0
k = w/s(w + w') - w'/r(w + w')