Hello,
I'm not sure if this is still the case, but previously, if you surrendered, this would not count as a loss. Therefore, if you surrender before you die, the game wouldn't count it as you have lost it.
My suggestion is to keep count of the amount you have surrendered, or basically implement it with the amount you have lost.
Then again... I'm not sure if this is still the case, as I have not tried it out yet.