Thanks for that, jcl. I'll try implementing this using the official approach by using my variables as arguments to the TMF and then storing them in TradeVars. I didn't understand that such parameters had to be passed as arguments to the TMF, but now I can see why that is the case.

Cheers