Metro stray currents flowing into neutral-point-grounded transformers can cause serious direct current (DC) bias. Affected by both metro train and urban power grid operations, transformer neutral-point DC caused by metro stray current is complex, dynamic, and time-varying, which changes the DC bias risk level of transformers. Thus, just installing blocking devices (BDs) at transformer neutral points with high instantaneous DC may make it difficult to comprehensively mitigate DC bias and lead to increased BD installation. To solve this, through optimizing BD installation placements, a mitigation method for transformer DC bias is proposed. In the proposed method, the DC bias risk level and BD installation number are included in the constraint and objective functions. To evaluate the risk level of transformer DC bias, four indicators are proposed considering the distribution characteristics of neutral DC. To optimize the BD installation placements, the effects of both the metro train dynamic operation and the operation topology of the urban power grid on neutral DCs are considered. The Monte Carlo method is used to sample the train operation conditions and a relation matrix among transformers is established. Applying the method to a certain power system, the result of BD installation placements shows that the transformers supplying the metro system must have BDs installed at their neutral points.