This paper presents a DC electric field calculation and optimization algorithm for a coaxial double-layer insulation. The stress cone curve of a 320 kV DC cable joint was optimized utilizing the algorithm under different conditions. The obtained results show that the stress cone curve becomes steeper with an increase of the x-axis electric field. The curve also becomes steeper with a decrease of the temperature difference between the stress cone and the conductor screen. The interface charge density along the interface between the XLPE and SiR decreases continually with the reduction of the temperature difference. The thermo-electric coupling simulations were performed using finite element simulation software. The obtained results illustrate that the temperatures, electric fields and interface charge density of the stress cone obtained by the algorithm and the simulation are consistent. Moreover, the optimized stress cone curve achieves the intended x-axis electric field under the given temperature difference. It is appropriate to use the algorithm to optimize the electric field in the stress cone area due to the evident efficiency.