Trex Q3 loss narrows