sorry i just saw the last entry and though this is an case for the help forum ... So i moved it twice.
And the ranking is calculated by points you get for the games while cup games are normally more worth then league games and higher division games bring more then low division games. The contribution of the point depends on the previous ranking + the difference of the game(you get points for a close game, and you have to win higher if you are far better placed then your opponent to gain all points)