We study the problem of evaluation of the probability of ruin of an insurance company for infinitely many steps in the case where the company can invest its capital to bank deposits at any time. As a distribution of the amounts of claims to the insurance company, we use the gamma-distribution with the parameters n and α.