I'm having trouble finding or creating a global variable that is accessible within the TMF, that can be kept with its asset.

For example I think AlgoVar[] should work in a while(asset(loop, but it doesn't seem to do what I want. After a few iterations, the values set in AlgoVar[0] do not seem to stay with their current asset, or perhaps they are getting reset when the loop changes

I want to be able to take a series value from run() and then inside the TMF for any trades taken under that asset, be able to access that value. However, the global value needs to stay with its asset, because during the while(asset(loop, different series values would be used for different assets.

Another possibility might be to set ThisTrade.TradeVar once I'm inside the TMF. But so far I don't know how to do this (but believe it should be possible).