Did you even set up your TMF correctly? Are you pointing to it when you call
enterLong/enterShort? If not, your code will not work.
These booleans will be set up whenever the TMF is called. Check them all and print stuff to the log to verify behavior:
TradeIsNewBar
TradeIsEntry
TradeIsStop
TradeIsProfit
At the bottom are some code samples showing a proper TMF setup:
https://zorro-project.com/manual/en/trade.htm