BarsPeriod
Previous Topic  Next Topic 

Definition
The primary Bars object period type and interval.

Property Value

A Period object.


Syntax
BarsPeriod.Id

BarsPeriod.Value


* Id can be of value PeriodType.Tick, PeriodType.Volume, PeriodType.Second, PeriodType.Range, PeriodType.Minute, PeriodType.Day, PeriodType.Week, PeriodType.Month, PeriodType.Year

* Value will return an integer value

Property Of

Custom Strategy


Examples

// Calculate only if there is a 100 tick chart or greater
protected override void OnBarUpdate()
{
    if (BarsPeriod.Id == PeriodType.Tick && BarsPeriod.Value >= 100)
    {
        // Indicator calculation logic here
    }
}