calculate rankings for users and stocks