For storing values specific to an asset and algo, AlgoVar is the right choice. But for selecting the right AlgoVar set, you need to call algo() with a valid algo name before, in the run function as well as in the TMF.
I do not know what trouble you're having, but if something does not work as expected, you can almost always find the reason by logging the variables with printf() commands.
Otherwise post the code that does not work and I'll look through it.