In this article we present a stochastic ordering verification algorithm between multivariate discrete distributions implemented in the C++ programming language. This algorithm is essential in problems of finding the optimal portfolio when dealing with discrete distributions.