NinjaScript > Educational Resources > Reference Samples > Indicator >

Exposing indicator values that are not plots

Print this Topic Previous pageReturn to chapter overviewNext page

There may be cases where you want to have your indicator calculate non-plotted values that you will want to access when using this indicator inside of another indicator or strategy.

 

Key concepts in this example

Creating exposed BoolSeries objects
Storing and retrieving values from BoolSeries objects

 

Important related documentation

BoolSeries class
Set()
Update()
BackColor
Reset()

 

We suggest using any available class that implements the IDataSeries interface. These include the following:

BoolSeries Class
DataSeries Class
DateTimeSeries Class
FloatSeries Class
IntSeries Class
StringSeries Class

 

Notes

There is an indicator and a strategy in the attached file used to demonstrate this concept. Please be sure to review both files.

 

Using these classes will provide you with a way to store calculated values associated to each bar in a chart. This will allow any referencing objects to access the historical calculated values. These classes hold internal logic that ensure that the OnBarUpdate() method of the indicator is processed prior to accessing the current bar’s value. This guarantees you will receive up-to-date values when retrieving the calculations.

 

In the event that an IDataSeries type class does not exist for the object type you wish to expose, you will need to use the Update() method within the property “getter” to ensure that OnBarUpdate() is processed and your calculated value is up-to-date.

 

Import instructions

1.Download the file contained in this Help Guide topic to your PC desktop
2.From the Control Center window, select the menu File > Utilities > Import NinjaScript
3.Select the downloaded file and click Import.

 

SampleBoolSeries_NT7.zip