BarsSinceNewTradingDay

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Common > Bars >

BarsSinceNewTradingDay

Previous page Return to chapter overview Next page

Definition

Returns the number of bars elapsed since the start of the trading day relative to the current bar processing.

 

Property Value

An int value representing the number of bars elapsed.  This property cannot be set.

 

Syntax
Bars.BarsSinceNewTradingDay

 

Examples

ns

// Only process strategy logic after five bars have posted since the start of the trading day
protected override void OnBarUpdate()
{
  if (Bars.BarsSinceNewTradingDay >= 5)
  {
    //Strategy logic here
  }
}