No, it would not work. Dependent on the order of trades, longhit would either never be true, or always.

Accessing other trades in a TMF has not been implemented, as it would require a less efficient software structure and make test and training much slower.