SetState()
<< Click to Display Table of Contents >> SetState() |
This method is used for changing the State of any running NinjaScript object.
Notes: •Attempting to set a State earlier than the current State will be ignored •Calling SetState() multiple times will be ignored to prevent the object from erroneously setting states unexpectedly •Setting State to State.Terminated is meant as a way to abort the strategy as it is running. Doing this in a Strategy Analyzer backtest will abort the backtest entirely, and no partial backtest results will be shown. •After setting State.Terminated, you should return from the calling method to help ensure subsequent logic is not processed asynchronously to OnStateChange() |
This method does not return a value.
Warning: This method should only be call after the State reaches State.DataLoaded |
state |
The State to be set |
protected override void OnBarUpdate() |