I'm looking to do a buy with a stop-limit order, then have a stop-loss market order and a limit order at my target. My question is what's the best practice for executing this reliably, and when either the target or stop-loss is reached, do I cancel the other order?

When I do the following: (within OnData())

if not self.Portfolio.Invested:
            self.stopLimitTicket = self.StopLimitOrder(self.stock, 100, entryStop, entryLimit)
            self.stopMarketTicket = self.StopMarketOrder(self.stock, -100, stopLoss)
            self.limitTIcket = self.LimitOrder(self.stock, -100, targetLimit)

I run into issues of some orders being invalid, and I'm worried that the stops remain in place if the limit order is filled, i.e., the two orders aren't syncronized.

Author