This document presents a novel method for designing ternary sequences using a modified simulated annealing algorithm (MSAA) to improve pulse compression in radar systems. It discusses the limitations of binary sequences and highlights the advantages of ternary sequences, particularly in improving discriminating and merit factors. Results show that the proposed method effectively generates ternary codes with better autocorrelation properties compared to existing techniques.