1. Yes, a TMF executes its code every tick, including if-statements in the code.
2. The "Stop" and "Trail" variables are only used when enterLong/Short is called, otherwise they have no meaning.
3. You can output any variable to a file with a sprintf statement. For caluclating parameters of closed trades, use an all_trades loop.