Hello, I am having difficulty entering stop loss orders. I place a Market Order as below:

OrderTicket newOrder = MarketOrder(symbol, lotSize);

I then try to immediately add a Stop Loss order:

this._stopLossTicket = StopMarketOrder(this.Symbol, this.Quantity * -1, price);

When I backtest this solution I get the following error:

 

Runtime Error: This asset symbol (USDCAD) was not found in your security list. Please add this security or check it exists before using it with 'Securities.ContainsKey("USDCAD")'

My Trades tab does show that my market order was filled. I assume that my market order is not updating my security list before I try to add the stop loss. What is the best practice for entering a stop loss on a new market order?

Thanks!