  We develop a novel procedure for estimating the optimizer of general convex
stochastic optimization problems of the form $\min_{x\in\mathcal{X}}
\mathbb{E}[F(x,\xi)]$, when the given data is a finite independent sample
selected according to $\xi$. The procedure is based on a median-of-means
tournament, and is the first procedure that exhibits the optimal statistical
performance in heavy tailed situations: we recover the asymptotic rates
dictated by the central limit theorem in a non-asymptotic manner once the
sample size exceeds some explicitly computable threshold. Additionally, our
results apply in the high-dimensional setup, as the threshold sample size
exhibits the optimal dependence on the dimension (up to a logarithmic factor).
The general setting allows us to recover recent results on multivariate mean
estimation and linear regression in heavy-tailed situations and to prove the
first sharp, non-asymptotic results for the portfolio optimization problem.
