On the basis of first-principles calculations of clusters and one dimensional infinitely long subnanowires of the binary systems, we find that alkali-noble metal alloy wires show better linearity and stability than either pure alkali metal or noble metal wires. The enhanced alternating charge buildup on atoms by charge transfer helps the atoms line up straight. The cesium doped gold wires showing significant charge transfer from cesium to gold can be stabilized as linear or circular monoatomic chains.