Error Messages and Developing for BloodHound
Please note, SharkIndicators does not provide any NinjaScript, programming, or coding support. This information is provided to assist you in your communication with the author of the indicator causing an issue or NinjaTrader support. Whomever is more pertinent in helping with the issue.
This page provides a list of some coding issues a 3rd party indicator may have, in turn causing errors with BloodHound or BlackBird. NinjaTrader is forgiving when running an indicator on a chart, but is very strict when running an indicator inside another indicator (i.e. using an indicator in BloodHound).
Error Messages from BloodHound
If you recieved this error, an indicator you are using has the MaximumBarsLookBack setting internally locked. NinjaTrader 8 throws an error when validating that indicator’s historical data. The setting is MaximumBarsLookBack.TwoHundredFiftySix. NinjaTrader documentation link.
Ask the programmer to remove all references to MaximumBarsLookBack.TwoHundredFiftySix, or change all MaximumBarsLookBack.TwoHundredFiftySix to MaximumBarsLookBack.Infinite Either solution will remove the limitation and error.
// SEARCH FOR ALL INSTANCES OF THIS TEXT //
// CHANGE THEM TO //
This is a NinjaTrader 8 issue. When indicator data is being validated, using .IsValidDataPoint(x), NinjaTrader 8 throws an error instead of stating the data is invalid. NT 7 did not have this issue.
Other Error Messages
DevExpress… is not a Visual or Visual3D
This error is benign. It is caused by a NinjaScript Add On that summons a list of objects and invokes those elements as a Visual object.
The NinjaAddons.ShortcutToolbar Add On is known to cause this error.
Example of offending code
VirtualizingStackPanel verticalStackPanel = null;
foreach (var v in chartGrid.Children)
if ( v is VirtualizingStackPanel &&
// VirtualizingStackPanel is a Visual element
(v as VirtualizingStackPanel).Uid == "ShortCutToolbar")
verticalStackPanel = v as VirtualizingStackPanel;
Developing for BloodHound
NT8 NinjaScript Requirements & Limitations
These are common coding mistakes and bad practices that can cause errors.
Be sure to initialize Plots in accordance with NinjaTrader requirements. See documentation here, Indicator » AddPlot()
Series<T> Initializing and Synchronizing
A Series<T> can cause the following errors and other similar errors;
When calling an indicator from another indicator (i.e. using an indicator inside BloodHound) strict NinjaScript protocols must be followed. The following guidelines can eliminate those errors.
All Series<T> must be initialize in the OnStateChanged() » State.DataLoaded section of your code, in accordance with Series<T> NinjaScript documentation. Initializing anywhere else can cause errors when BloodHound tries to access the Series.
Do not synchronize a Series<T> to a secondary Bars series.
E.G. myData = new Series<double>(this, BarArray, MaximumBarsLookBack.Infinite);
Do not specify a BarsArray. Allow the Series to sync to the primary Bars series.
BarsInProgress: If the indicator uses multiple Bars series (multi-timeframes), only set values to the Series during BarsInProgress zero. Setting values in any other Bars series can cause System.ArgumentOutOfRangeException: errors.
protected override void OnBarUpdate()
if(BarsInProgress == 0)
// Set values during this Bars series
mySeries = Close;
OnBarUpdate(): A public Series<T> must be set in OnBarUpdate(). Setting a public Series<> in other methods may create a synchronization issue. Per NinjaTrader's best practices, BloodHound calls guest indicator data during the OnBarUpdate() event. This is a timing issue with NinjaTrader's event driven methods.
OnMarketData(): A public Series<T> should not be set in this method. BloodHound uses OnBarUpdate() to access indicator values. Guest indicator that set a public Series<> in OnMarketData() return a null value. Values gained from OnMarketData() should be stored and set to public Series<> in OnBarUpdate().
Calculations in OnRender()
NinjaTrader does not call the OnRender() method when an indicator is called by another indicator, as is the case when using an indicator in BloodHound. OnRender() is only called when the indicator is running on a chart. Make sure no data is calculated in this method that is used for Plot values or Series<T> values. Therefore, perform calculations for visual purposes only in this method.
The ChartControl object is Null when an indicator is called by another indicator, as is the case when using an indicator in BloodHound. Make sure ChartControl properties are not required for the calculation of data (i.e. Plots or public Series<T>) that BloodHound will use.
Microsoft Visual Studio
When compiling your NinjaScript projects directly in Visual Studio, if you plan to reference any of SharkIndicators’ .dll’s, you will need to first set the target .NET version from the default 4.5 to 4.5.2.
To do this, right click the NinjaTrader.Custom project in visual studio and select Properties.
Under the Applications tab find the Target Framework and set that to .NET Framework 4.5.2.
NinjaScript Indicator Tester
This is an indicator "wrapper" that creates the same environment as using an indicator in BloodHound. This wrapper is intented to help indicator developers debug their indicators by visually seeing, on the chart, the data that BloodHound/BlackBird is receiving. NinjaTrader is forgiving when running an indicator on a chart, but is very strict when running an indicator inside another indicator.
Instructions on how to use this wrapper are written within the code. Open this indicator using the NinjaScript Editor to read. Knowledge of NinjaScript programming is required.
Please Note: SharkIndicators does NOT provide any type of programming help or support in any form! If you need assistance, you should contact a NinjaScript programmer, or the author of the indicator you are trying to test, or NinjaTrader support for general NinjaScript help.
Import into NinjaTrader 8 using the standard .zip file import process.
Click to download, IndicatorTesterForBloodHound_NT8.zip