Problem is that I have no real example: AFAIK in none of our scripts we've used a TradeVar or AssetVar. But the original script of the thread starter would need two AssetVars if it were a portfolio script. They would be defined this way:

#define LastWeekClose AssetVar[0]
#define CancelOtherTrades AssetVar[1]

and then can be set and reset in a TMF as well as in the main script.