Error messages a third-party indicator can cause in BloodHound or BlackBird, the coding mistakes behind them, and how to remove the Developer Extensions.
No programming support
SharkIndicators doesn’t provide NinjaScript, programming or coding support. This page is here to help you talk to the author of the indicator causing the problem, or to NinjaTrader support, whichever can help more.
NinjaTrader is forgiving when an indicator runs on a chart, but strict when an indicator runs inside another indicator, which is what happens when you use an indicator in BloodHound. The mistakes below are the usual causes.
Error messages from BloodHound
MaximumBarsLookBack.TwoHundredFiftySix

An indicator you’re using has its MaximumBarsLookBack setting locked to MaximumBarsLookBack.TwoHundredFiftySix in its code, and NinjaTrader 8 throws an error when BloodHound validates that indicator’s historical data.
Ask the indicator’s programmer to remove every reference to MaximumBarsLookBack.TwoHundredFiftySix, or to change them all to MaximumBarsLookBack.Infinite. Either removes the limit and the error.
// Search for every instance of
MaximumBarsLookBack.TwoHundredFiftySix;
// and change it to
MaximumBarsLookBack.Infinite;
It’s a NinjaTrader 8 issue: when indicator data is checked with IsValidDataPoint(), NinjaTrader 8 throws an error instead of reporting the data as invalid.
Other error messages
DevExpress… is not a Visual or Visual3D

This error is harmless. It comes from a NinjaScript add-on that gets a list of objects and treats them as Visual objects. The NinjaAddons.ShortcutToolbar add-on is known to cause it. Example of the 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;
break;
}
Developing for BloodHound
Common NinjaScript mistakes
BloodHound has no special requirements for reading other indicators, apart from the MaximumBarsLookBack setting above. These are common coding mistakes and bad practices that cause errors.
AddDataSeries()
See ChartControl and other null objects below.
Brushes
Follow NinjaTrader’s Working with Brushes guidelines when you define custom brushes. Above all, freeze custom brushes to prevent threading errors, as NinjaTrader’s documentation warns many times.
Don’t change brush properties in State.SetDefaults or State.Configure: that causes threading problems for the hosting indicator or strategy (BloodHound or BlackBird). Change them in State.DataLoaded or later. For example, don’t set the opacity here:
else if (State == State.Configure)
{
myBackgroundColor = BackgroundColor.Clone();
myBackgroundColor.Opacity = BackgroundOpacity * 0.01; // too early
myBackgroundColor.Freeze();
}
Brushes don’t matter to an indicator running inside BloodHound or BlackBird, since it can’t draw on the chart, so BloodHound and BlackBird ignore brush properties.
Plots
Create plots as NinjaTrader requires (Indicator » AddPlot()). We’ve seen many indicators create plots in the wrong OnStateChange() state. Set plot values by the rules in Setting values below.
Series<T>: creating and synchronizing
BloodHound can read Series<T> of these types: bool, int, double and long. A Series<T> can cause errors such as:
- System.IndexOutOfRangeException
- System.ArgumentOutOfRangeException
- System.NullReferenceException
When one indicator calls another (as BloodHound does), strict NinjaScript rules apply. These guidelines get rid of those errors.
Creating. Create every Series<T> in OnStateChange() during State.DataLoaded, as the Series<T> documentation says. Creating it anywhere else can cause errors when BloodHound reads the series.
Synchronizing. Don’t synchronize a Series<T> to a secondary bars series. Don’t pass a BarsArray; let the series sync to the primary bars series.
// Don't do this
myData = new Series<double>(this, BarsArray[1], MaximumBarsLookBack.Infinite);
Setting values.
- BarsInProgress. If the indicator uses more than one bars series (multiple timeframes), set the series’ values only when BarsInProgress is 0. Setting them for any other bars series can cause System.ArgumentOutOfRangeException errors.
- OnBarUpdate(). Set a public Series<T> in OnBarUpdate(). Setting it in other methods can put it out of sync: following NinjaTrader’s best practices, BloodHound reads an indicator’s data during OnBarUpdate(), and NinjaTrader’s event-driven methods run at different times.
- OnMarketData(). Don’t set a public Series<T> here. Indicators that do return null to BloodHound. Store what you get from OnMarketData() and set the public series in OnBarUpdate().
protected override void OnBarUpdate()
{
if (BarsInProgress == 0)
{
// Set values for the primary bars series only
mySeries[0] = Close[0];
}
}
Calculations in OnRender()
NinjaTrader doesn’t call OnRender() when one indicator calls another, as in BloodHound; it’s only called when the indicator is on a chart. Don’t calculate anything in OnRender() that plot values or Series<T> values depend on. Use it for visuals only.
ChartControl and other null objects
ChartControl is null when one indicator calls another, as in BloodHound. Make sure your indicator doesn’t use ChartControl or its properties when it runs inside another indicator.
Instrument is null during State.Configure, so using it directly in AddDataSeries() causes a null reference error, because Instrument doesn’t exist yet:
AddDataSeries(Instrument.FullName, _barsPeriodType, _Period); // Instrument is null here
Other null objects
Other NinjaScript objects can be null too when an indicator runs inside another indicator. Check NinjaTrader’s NinjaScript documentation, which NinjaTrader keeps improving.
Manual removal and fixing Developer Extensions errors
For developers only
SharkIndicators doesn’t support the Developer Extensions or software development. Only install the Developer Extensions if you’re a software developer building indicators or strategies that use BloodHound, and know what they are.
These steps remove the SharkIndicators software from NinjaTrader completely. If you’re removing the Developer Extensions, pay particular attention to the Developer Extensions files in step 5 and the Config.xml step.
- Remove all custom NinjaScript code that uses BloodHound, such as TDU BloodHound Statistics or Smart TradeMarkers. Every custom strategy and indicator that uses BloodHound must be removed from NinjaTrader first:
• Protected indicators from other vendors: in the Control Center, Tools » Remove NinjaScript Assembly.
• Open-source indicators and strategies: delete them in Windows File Explorer. - Close NinjaTrader.
- Uninstall the SharkIndicators software: open Windows Settings » Apps » Installed apps, find SharkIndicators, and click Uninstall.
- Restart your computer. This clears file locks, among other things. Don’t start NinjaTrader yet.
- In File Explorer, open
Documents\NinjaTrader 8\bin\Custom\and delete every file with SharkIndicators, AWSSDK, Betwixt, Castle.Core, Jil, Ninject, PLUS or Sigil in its name. Don’t delete files ending in .lic.
• Developer Extensions: SharkIndicators.BloodHound.cs and SharkIndicators.Common.cs are Developer Extensions files.
• In...\bin\Custom\Strategies\, delete SiBloodHoundStrategyExample.cs and SiBloodHoundStrategyExample2.cs if they’re there, and any other custom strategy that uses BloodHound. - Skip this step if the Developer Extensions aren’t installed. It removes the Developer Extensions references from Config.xml. If they were installed for a tool such as TDU BloodHound Statistics or Smart TradeMarkers, you may want that tool’s support to help you. In
Documents\NinjaTrader 8\, right-click Config.xml and choose Open with » Notepad. Find the <References> section and delete the two lines that list SharkIndicators DLLs (pictured below). - Start NinjaTrader (without the SharkIndicators software).
- Compile NinjaScript to test: in the Control Center, New » NinjaScript Editor, then right-click in the editor and select Compile (F5).
- If the NinjaScript Editor shows errors: the files in the picture below can be deleted, as in step 5. If other files are listed, NinjaTrader support or the company the file came from can help you fix the error.
- If there are no errors, close NinjaTrader and reinstall the SharkIndicators software.



Microsoft Visual Studio
If you compile your NinjaScript projects in Visual Studio and reference any SharkIndicators DLLs, first change the target .NET version from the default 4.5 to 4.8: right-click the NinjaTrader.Custom project and select Properties, then on the Application tab set Target framework to .NET Framework 4.8.

NinjaScript Indicator Tester
An indicator “wrapper” that creates the same environment as using an indicator in BloodHound. It helps indicator developers debug their indicators by showing on the chart the data BloodHound and BlackBird receive. Instructions are in the code: open the indicator in the NinjaScript Editor to read them. You’ll need to know NinjaScript.
Download IndicatorTesterForBloodHound_NT8.zip and import it into NinjaTrader 8 the usual way (Tools » Import » NinjaScript Add-On).
No programming help
SharkIndicators doesn’t provide programming help of any kind. For help, contact a NinjaScript programmer, the author of the indicator you’re testing, or NinjaTrader support for general NinjaScript questions.