A transmembrane helix (TMH) topology prediction is becoming a central problem in bioinformatics because the structure of TM proteins is difficult to determine by experimental means. Therefore, methods which could predict the TMHs topologies computationally are highly desired. In this paper we introduce TMHindex, a method for detecting TMH segments solely by the amino acid sequence information. Each amino acid in a protein sequence is represented by a Compositional Index deduced from a combination of the difference in amino acid appearances in TMH and non-TMH segments in training protein sequences and the amino acid composition information. Furthermore, genetic algorithm was employed to find the optimal threshold value to separate TMH segments from non-TMH segments. The method successfully predicted 376 out of the 378 TMH segments in 70 testing protein sequences. The level of accuracy achieved using TMHindex in comparison to recent methods for predicting the topology of TM proteins is a strong argument in favor of our method.