Portfolio theory mainly studies how to optimize the allocation of assets under the premise of maximizing expected returns and minimizing investment risks. In view of the instability of the financial market, a diversified investment portfolio can help control the loss of the investment portfolio. In addition to paying attention to the safety and return of asset allocation, we cannot ignore the liquidity of assets, that is, their liquidity. Adding high-liquidity products to asset allocation, such as equity investment, can better control the financial cash flow in response to emergencies. One of the ways to make assets flow is to securitize assets and sell them to the market. In order to revitalize the stock assets, good investment efficiency is a necessary choice for financial investment. Various financial products and their derivatives continue to enter people’s vision. There are many financial products in reality, and optimizing the investment portfolio can bring high economic benefits. The purpose of this paper is to study the application of optimization algorithms in financial portfolio problems. (1) Monetary policy remains prudent and neutral. It is not easy to expect flooding, but flexibility is required in complex situations. (2) Financial resources are tilted towards innovation and transformation and capital markets, which is beneficial to the development of capital markets in the medium and long term. (3) Unblocking the transmission mechanism is conducive to lenient credit and tapping the wrong killing opportunities in private enterprise debt. (4) Banks and other financial institutions have moderate pressure to give benefits to entities, but in the long run, the interests of the two are consistent. (5) Finance risk prevention will continue, orderly breaking the rigid exchange and reshaping the financial structure and ecology. (6) The pace of opening up of the financial industry has accelerated, and the bond market investor structure has improved. In this paper, we establish different optimization schemes to compare and study the portfolio problem and then use MATLAB to solve the modeling and programming problem, calculate the highest return rate and the lowest risk value before and after optimization, and then make a comparative analysis to get a better optimization scheme. The results show that the genetic algorithm model is superior to the quadratic programming method in terms of risk control. The minimum risk of portfolio optimization through genetic algorithm has been reduced by about 40%, and the maximum return has increased by about 25%. The comprehensive optimization effect is better than the quadratic planning method and ultimately can obtain higher economic benefits. It can be seen that the optimization algorithm is of great significance for the comparative study of financial portfolio problems.