This is impossible to calculate, and anything you do calculate will just be a numeric "explanation" which you created and can fluctuate because of other external factors. Also, your "risk of ruin" should evolve (just like your win rate), making it more challenging to "pin down" or grasp.
I understand the interest in figuring something like this out, but honestly the "stopping at $17 or bust" is just a self inflicted filter you are placing on your own game. If you are at a table where you get to $17 within 50
hands, why stop?!?!?!? Conversely, if you are seated at an uber tough table, where you are struggling to stay above break even, continuing to play for the sake of "$17 or bust" seems like a mistake.
Conclusion: Many more variables besides 'win rate' should be considered, if an attempt to calculate "risk of ruin" is to be made. I would stop here (in the calculations), and simply play the tables that feel comfortable and stable (consistent 20BB/100 poker!).