4. The maximum value of the function $f(x)=\frac{\frac{1}{6} \cdot(-1)^{1+C_{2 x}^{x}} \cdot P_{x+2}^{5}}{1+C_{3}^{2}+C_{4}^{2}+\cdots+C_{x-1}^{2}}$ is ( ).
(A) 20
(B) 10
(C) -10
(D) -20
4. (D).

From $x-1 \geqslant 2$ and $x+2 \geqslant 5$, we get the domain of $f(x)$ as $\{x \mid x \geqslant 3, x \in N\}$.
$\because \quad C_{2 x}^{x}=\frac{(2 x)!}{x!\cdot x!}=\frac{(2 x) \cdot(2 x-1)!}{x \cdot(x-1)!\cdot x!}$ $=2 C_{2 x-1}^{x}$ is even,
$$
\begin{array}{l}
\therefore \quad \frac{1}{6} \cdot(-1)^{1+C_{2 x}^{x}} \cdot P_{x+2}^{5}=-\frac{1}{6} P_{x+2}^{5} \\
\quad=-\frac{1}{6}(x+2)(x+1) x(x-1)(x-2), \\
1+C_{3}^{2}+C_{4}^{2}+\cdots+C_{x-1}^{2} \\
=C_{x}^{3}=\frac{1}{6} x(x-1)(x-2) . \\
\therefore \quad f(x)=-(x+2)(x+1) .
\end{array}
$$

Clearly, $f(x)$ is a decreasing function in its domain,
$\therefore$ when $x=3$, $f(x)_{\text {max }}=-20$.