Playing around with things I have found I can add tags with the MarketOrder constructor using the syntax self.MarketOrder(Symbol symbol, Decimal quantity, DateTime time, String tag)  with each parameter as a positional argument and all parameters stated. The equivelant does not work for me with StopMarketOrder.

I couldn't attach the failed backtest, so I commented the failed StopMarketOrder tag attempt. The error it gives is "Runtime Error: Trying to dynamically access a method that does not exist throws a TypeError exception. To prevent the exception, ensure each parameter type matches those required by the StopMarketOrder method. Please checkout the API documentation. at OnData in 78 TypeError : No method matches given arguments for StopMarketOrder'