For error-handling, money-management or any other reason you may want to halt your strategy from processing its' core program logic. Before you halt your strategy, it is best to close all positions and cancel all active orders to prevent the risk of having an unmanaged position in the market. We have provided two reference samples for these topics.
Key concepts in the SampleHaltBasicStrategy example*
Key concepts in the SampleHaltAdvancedStrategy example**
* This is intended for strategies driven exclusively by the OnBarUpdate() method.
** This sample's intended audience is for advanced programmers who have programmed strategies that take advantage of event-driven methods such as, but not limited to, OnMarketData() or OnOrderUpdate() in addition to the OnBarUpdate() method.
Important related documentation