Tension and compression in truss bars can be visually verified by deformed shape (4), exaggerated for clarity. Bars in tension will elongate; bars in compression will shorten.
In the truss illustrated the top chord is in compression; the bottom chord is in tension; inward sloping diagonal bars in tension; outward sloping diagonal bars in compression.
Since diagonal bars are the longest and, therefore, more likely subject to buckling, they are best oriented as tension bars.
1 Truss diagram
2 Force polygon
3 Tabulated bar forces (+ implies tension, - compression)
4 Deformed truss to visualize tension and compression bars
A Bar elongation causes tension
B Bar shortening causes compression