Optimal strategy to maximize the expected gains of a probability based game The game: you start with nothing, and you choose to roll a fair dice as many times as you want. Each of the 6 outcomes is attached with a certain $ value, except for one, where you will lose all that you gained and the game ends.
My question: Mathmaitcally speaking, is there an optimal stopping rule that maximizes the expected gains of a single game?
There are two possible kinds of strategies:
1- Stop after n rounds
2- Stop as soon as your balance exceed $k
The latter makes more sense to me, as the former feels like I'm indulging in some kind of gambler's fallacy.
 A: Alternative approach 
First, I will assume that if you roll a $2,3,4,5,$ or $6$, that you win $2,3,4,5,6$, respectively.  I will then illustrate my approach.  Then, I will show the adjustment for different fixed winnings attached to the rolls of $2,3,4,5,6$.
If you roll, and don't hit $(1)$, your average gain will be $(4)$, which is the average of $\{2,3,4,5,6\}$.  Suppose that your accumulated total so far is $T$.  Then your expectation on the next roll is
$$\frac{1}{6}(-T) + \frac{5}{6}(4) = \frac{1}{6}[(4 \times 5) - T].$$
Therefore, if $T < 20$, you should roll, if $T > 20$ you should stop, and if $T = 20$, you are ambivalent.
Note
If $T > 20$, it is impossible to have a positive expectation on any subsequent roll.  This is because, if you don't hit $(1)$ on this roll, your accumulated winnings will have necessarily increased from $T$, to $T^+$ (i.e. $T + $ some positive value).
Therefore, if it assumed that $T > 20$, then $T^+$ must also be $> 20.$

Suppose instead that the winnings for rolls of $2,3,4,5,6$ are $n_2,n_3,n_4,n_5,n_6$ respectively, where $N = (n_2 + \cdots +  n_6)$  Then, if you roll and don't hit $(1)$, your average winnings are $(N/5).$
Therefore, the above analysis is paralleled by :
$$\frac{1}{6}(-T) + \frac{5}{6}(N/5) = \frac{1}{6}[N - T].$$
Therefore, if $T < N$, you should roll, if $T > N$ you should stop, and if $T = N$, you are ambivalent.
A: Let $N_1,\dots,N_5$ be earnings on outcomes $\{1,\dots,5\}$ such that $N_1+\dots+N_5 = N$. Let $X_i$ be the earnings after i'th round.
$\mathbb E [X_i] = \frac{5}{6} N - \frac{1}{6} X_{i-1}$. A fair strategy is to play when you expect to win from playing the game. Thus you play till $\frac{5}{6} N - \frac{1}{6} X_{i-1} \geq 0$ In other words, stop when $\frac{5}{6} N < \frac{1}{6} X_{i-1}$ or $5 N < X_{i-1}$.
Thus your strategy (2) is right. Stop when your balance exceeds $5N = 5(N_1+\dots+N_5)$
