In the oil and gas industry, which is the basis of the Russian energy market, a significant and urgent question arises: How to distribute companies according to their investment attractiveness? Accordingly, quantitative indicators are needed. Lacking extensive experience in the practical implementation of fundamental rating tools, work is needed to develop methodologies of weighting coefficients and lists, built on the experience of the “big three” rating agencies. The article proposes an algorithm for forming an integral rating of companies based on financial reporting indicators and the author’s rules of fuzzy logic based on the principle of “circular convolution”, from the best to the slave, deepening the analysis to the center, when all companies are exhausted and places in the rating are distributed. The problem of assessing and integrally indexing the indicators of large companies in leading sectors of the economy (e.g., oil and gas, banks, electricity) is becoming manifest, while it is obvious that there is competition between large companies of the country’s leading industries for state investment resources. The nature of the leading industries is such that it is necessary to assess the quality of the company’s functioning based on the formation of rating groups. Based on the rating, investments are distributed among the companies under consideration. The author has developed a portfolio model that is analogous to the Harry Max Markowitz model, which does not contradict this model but allows consideration of a broader range of risk assessments used in the model (for example, the rating of companies). The optimal portfolio is built, taking into account the resulting index and the initial grouping in the hierarchical data correction mode. The logically sequential method of circular convolution of four important indicators to an integral index and a mathematically substantiated method for optimizing the minimax portfolio presented in the work will allow the investor to develop optimal (from the point of view of the transparency of the apparatus used, mathematical feasibility and time spent on the implementation of the software package) tools for investing and enlarging his capital.