Yes, TMFs can edit global variables, but they can not access other trades. This is not due to some programming issue, but because they run at a different time. When a TMF of trade 1 looks into trades 2 and 3, trade 2 may be still at the begin of the bar and trade 3 is already at end of the bar. So they both have wrong values in comparison to trade 1.

Of course this happens only in the simulation, in real trading a TMF could theoretically access other trades. But doing that is certainly not a good idea because, aside from other reasons, you can't simulate it.