You have made a few typos. The basic idea is for asset returns $r_i$ where $i$ denotes the observation (often, $i$ indexes days), you have:
$$
\begin{align}
M0 &= \sum_i 1_{r_i} = \text{# of returns} \\
M1 &= \sum_i r_i/M0 = \text{mean return} \\
M2 &= \sum_i (r_i-M1)^2/M0 = \text{variance of returns}^* \\
M3 &= \sum_i (r_i-M1)^3/M0 = \text{third moment}^* \\
M4 &= \sum_i (r_i-M1)^4/M0 = \text{fourth moment}^*
\end{align}
$$
with the * meaning a big caveat that these are actually wrong in terms of not being the correct degrees of freedom: the M2 sum should be divided by $M0-1$; the M3 and M4 sums should be divided by $M0-2$. (Is dividing by M0 alone gravely wrong? If you have a small dataset, yes.)
The skewness is then $M3/M2^{3/2}$ and kurtosis is $M4/M2^2$.
Finally... if you are "not very good at finance," you should realize that you have jumped into some of the more complicated material in finance and what is definitely graduate-level statistics. Playing with Cornish-Fisher and Edgeworth expansions is not something I would advise when you are just trying to understand the variables being referred to (e.g. $r_i$).
I highly recommend you consult a text that can explain at least a little of this to you. Chapter 8 of A Quantitative Primer on Investments with $R$ covers these expansions and other methods and Kolassa's Series Approximation Methods in Statistics is a more in-depth reference (with McCullagh's Tensor Methods in Statistics going into even greater depth).