Stop and Trail variables must be always set accordingly before you enter a trade that is supposed to stop and trail. It does not matter whether in a TMF or elsewhere.

Of course I'm not sure when and how you want to stop and trail, so I can't give a detailed advice. The best way for getting help is describing your algorithm in words and posting the code that you have so far - then people can see what's wrong. If your algorithm is top secret, you can alternatively subscribe a support ticket on the download page and contact Zorro Support for help.