Never run trade loops inside a TMF, unless you have a very good reason to! (This is not one of them.)

Also, I assume you correctly assigned a TMF to a trade. Did you do that? This happens when you call enterLong(myTMF) or enterShort(myTMF).