IsResetOnNewTradingDays

<< Click to Display Table of Contents >>

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

IsResetOnNewTradingDays

Previous page Return to chapter overview Next page

Definition

Determines if the specified bar series is using Break at EOD

 

Note:  The property available on the UI will override any values set in code. Please see the help guide topic on using Break at EOD for more information

 

Property Value

A bool[] when true, indicates the specified BarsArray is setup to run Break at EOD; otherwise false.  Default value is false

 

Syntax

IsResetOnNewTradingDays[int idx]

 

 

Warning:  This property should NOT be accessed within the OnStateChange() method before the State has reached State.DataLoaded

 

Examples

ns



protected override void OnStateChange()
{
  if (State == State.SetDefaults)
  {
    Name = "Examples Indicator";
  }
 
  else if (State == State.Configure)
  {
    //Add AAPL 1 minute with RTH trading hours, set to break EOD
    AddDataSeries("AAPL", new BarsPeriod() { BarsPeriodType = BarsPeriodType.Minute, Value = 1 }, 50, "US Equities RTH", true);
  }
 
}
protected override void OnBarUpdate()
{                
//Print out the current bars series name and break EOD setting on start up

//   IsResetOnNewTradingDays[0]  Primary
//   IsResetOnNewTradingDays[1]  AAPL

 
if (CurrentBar == 0)        
  Print(BarsArray[BarsInProgress].ToChartString() + " " + IsResetOnNewTradingDays[BarsInProgress]);
 
//Output:
//ES 03-15 (1 Minute) True
//AAPL (1 Minute) False        
}