Bars Type

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference >

Bars Type

Previous page Return to chapter overview Next page

Creating custom Bars Types allows for incredible flexibility in the way you want to present data in a chart. The methods and properties covered in this section are unique to custom Bars Type development.

 

Methods and Properties

AddBar()

Adds new data points for the Bars Type.

ApplyDefaultBasePeriodValue

Sets the default base values used for the BarsPeriod selected by the user (e.g., the default PeriodValue, DaysToLoad, etc.) for your custom Bar Type.

ApplyDefaultValue

Sets the default BarsPeriod values used for a custom Bar Type.

BuiltFrom

Determines the base dataset used to build the BarsType (i.e., Tick, Minute, Day).

GetInitialLookBackDays()

Determines how many days of data load when a user makes a "bars back" data request.

GetPercentComplete()

Determines the value your BarsType would return for Bars.PercentComplete

Icon

The shape which displays next to the Bars Type menu item.

IsRemoveLastBarSupported

Determines if the bars type can use the RemoveLastBar() method when true, otherwise an exception will be thrown.

IsTimebased

Used to indicate the BarsType is built from time-based bars (day, minute, second).

OnDataPoint()

OnDataPoint() method is where you should adjust data points (bar values) of your series through AddBar() and UpdateBar().

RemoveLastBar()

Removes the last data point for the Bars Type.

SessionIterator

Provides trading session information to the bars type. Must be built using the bars object.

UpdateBar()

Updates a data point in our Bars Type.