Phase change material (PCM) wall is expected to match the building type and its climate region effectively. In order to meet the space cooling and heating of residential buildings in hot summer and cold winter regions in China, a new active casing pipe macro-encapsulated PCM wall is proposed, in which the cold storage and heat storage PCMs are sealed between the inner pipe and outer pipe with no leakage. To obtain the optimal structure parameters and better thermal performance of the PCM wall, the mathematical model of the PCM wall is established and validated by experiment, and the effects of PCM filling pattern, structural parameter of casing pipe, water temperature in inner pipe and indoor setting temperature are simulated and analyzed. The results show that the optimal PCM filling pattern is to fill the cold storage PCM and heat storage PCM in the gap between the inner pipe and outer pipe separately; the optimal PCM filling thickness is 13 mm; the optimal structural parameters are inner pipe diameter of 20 mm and casing pipe centre spacing of 61 mm. The water temperature in the inner pipe and PCM energy storage/release time reasonably match the indoor setting temperature. Under the optimal operating conditions, the average PCM wall surface temperatures of 20.5 and 26.8 ℃ and the PCM wall surface heat fluxes of 45.9 and 57.2 W/m2 can be obtained in summer and winter conditions, respectively. The research provides an optimized casing pipe macro-encapsulated PCM wall system that can reliably and efficiently meet both the space heating and cooling demands of residential buildings in hot summer and cold winter regions in China.