NinjaScript > Language Reference > Strategy >

ExitOnClose

Print this Topic Previous pageReturn to chapter overviewNext page

Definition

Indicates if the strategy will cancel all strategy generated orders and close all open strategy positions at the close of the session. This property can be set programatically in the Initialize() method or be driven by the UI at run time. See also "ExitOnCloseSeconds".

 

Property Value

This property returns true if the strategy will exit on close; otherwise, false.

 

Syntax

ExitOnClose

 

 

Examples

protected override void Initialize()
{
    // Triggers the exit on close function 30 seconds prior to session end
    ExitOnClose = true;
    ExitOnCloseSeconds = 30;
}