IsDataSeriesRequired

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Common > OnBarUpdate() >

IsDataSeriesRequired

Previous page Return to chapter overview Next page

Definition

Determines if a Data Series is required for calculating this NinjaScript object.  When set to false, data series related properties will not be displayed on the UI when configuring.

 

Note:  When set to false, methods and properties which are dependent on Bars will NOT be used.  This means you will not receive any calls to OnBarUpdate() or be able to access historical bar prices.

 

 

Property Value

This property returns true if the NinjaScript requires a Data Series; otherwise, false.  Default value is true.

 

Warning:  This property should ONLY bet set from the OnStateChange() method during State.SetDefaults or State.Configure

 

 

Syntax

IsDataSeriesRequired

 

 

Examples

ns


protected override void OnStateChange()
{
    if (State == State.SetDefaults)
    {
        IsDataSeriesRequired = false;
    }
}