4. In the arithmetic sequence $\left\{a_{n}\right\}$, if $\frac{a_{11}}{a_{10}}<-1$, and the sum of the first $n$ terms $S_{n}$ has a maximum value. Then, when $S_{n}$ achieves its minimum positive value, $n=$ $\qquad$ .
4. 19 .

Since the sum of the first $n$ terms of the arithmetic sequence $\left\{a_{n}\right\}$, $S_{n}$, has a maximum value and a minimum positive value, then the first term $a_{1}>0$, common difference $d<0, a_{10}>0, a_{11}<0, \\
S_{19}-S_{1}=\frac{18\left(a_{2}+a_{19}\right)}{2}=9\left(a_{10}+a_{11}\right)<0 .
\end{array}
$

Therefore, when $S_{n}$ takes the minimum positive value, $n=19$.