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:

NinjaTrader 8
For NT8 We suggest using and avaliable class that implements the Series interface.

NinjaTrader 7

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

NT7 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:

NinjaTrader 8
  1. Download the file contained in this thread to your PC desktop
  2. From the Control Center window, select the menu Tools > Import > NinjaScript
  3. Select the downloaded file


NinjaTrader 7
  1. Download the file contained in this thread 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.
Attached Files