Hi,

I see here two potential issues:
1. Can you tell us to which value you set LookBack? For a 200-EMA you need a high number in LookBack (I would say more than 200 as this is only valid for SMA and not EMA).
2. The variable TradeIsOpen has only valid entries when using in a tmf or in a loop like for(open_trades). If you use it outside of those two this is incorrect.

To tell more I need to see the rest of you code. But maybe you can search in the manual for tmf and you will find the answer by your own.

Cheers