The default behavior for NinjaTrader is to cancel limit orders if the trigger conditions are no longer true. It is possible to submit orders that stay active until cancelled by setting liveUntilCancelled to true. This sample demonstrates and explains the difference between submitting an order with isLiveUntilCancelled true and false. The comments contain a longer, more detailed explanation.
Key concepts in this example
*Another sample demonstrating how to explicitly cancel orders can be found here: Using CancelOrder() method to cancel orders
Important related documentation