Another example for when you would want to use this is if you were trying to access the Pivots indicator, but did not have enough days loaded to properly calculate those values yet. Basing logic on the Pivots in such a scenario would yield values that are not useful and can be detrimental if not handled correctly in your code.
Key concepts in this example:
- Checking indicator plots for valid values
- Handling logic for when the indicator plots are not valid
Attached archive contains two indicator files.
- SampleEveryNBarTest is the hosting indicator
- SampleEveryNBar is the hosted indicator
Note: When hosting an indicator in an Indicator column in the Market Analyzer you will need to manually ensure enough bars back are loaded for the indicator to calculate correctly.
Important related documentation:
NinjaTrader 8
NinjaTrader 7
Import instructions:
NinjaTrader 8
- Download the file contained in this thread to your PC desktop
- From the Control Center window, select the menu Tools > Import > NinjaScript
- Select the downloaded file
NinjaTrader 7
- Download the file contained in this thread to your PC desktop
- From the Control Center window, select the menu File > Utilities > Import NinjaScript
- Select the downloaded file and click Import.