Heavy quarks are initially produced in nuclear collisions and the number is conserved during the evolution of the system. We establish a sequential coalescence model with charm conservation and apply it to charmed hadron production at RHIC and LHC energies. The charm conservation enhances the earlier formed hadrons and reduces the later formed ones, which leads to a $D_s/D^0$ enhancement and a $\Lambda_c/D^0$ suppression. The mass dependence of the sequential hadron formation provides us a new tool for studying the quark-gluon plasma hadronization in high energy nuclear collisions. In the meantime, we have extend this framework to study the $D_s/D^0$ and $\Lambda_c/D^0$ at high baryon density regions.