Market Analyzer Column Value[0] always shows "..." — OnBarUpdate not updating display

I am building a custom Market Analyzer Column in NinjaTrader 8 and cannot get any value to display in the column cell. It always shows “…” no matter what I do.

Here is my minimal test code:

csharp

protected override void OnStateChange()
{
    if (State == State.SetDefaults)
    {
        Calculate           = Calculate.OnEachTick;
        MaximumBarsLookBack = MaximumBarsLookBack.Infinite;
    }
}

protected override void OnBarUpdate()
{
    Value[0] = Close[0];
}

protected override void OnMarketData(MarketDataEventArgs e)
{
    Value[0] = Close[0];
}

Column settings:

  • Calculate: On each tick
  • Maximum bars look back: Infinite
  • Bars to load: 300
  • Type: Minute, Value: 5

Questions:

  1. Is Value[0] the correct property to set for displaying a number in the column cell?
  2. Does OnBarUpdate fire for Market Analyzer Columns?
  3. What is the correct method to output a value that displays in the column cell?
  4. Is there a working minimal example of a custom Market Analyzer Column that displays a calculated value?

NinjaTrader version: 8

Adding a plot and setting the Value[0] output should be sufficient to display in a market analyzer column via the “indicator” column selection. It looks like your sample code is missing the AddPlot() call. You’ll want to add the plot to setup the output and make sure you select the plot name you want to see in the column properties.

			if (State == State.SetDefaults)
			{
				Description					= Custom.Resource.NinjaScriptIndicatorDescriptionATR;
				Name						= Custom.Resource.NinjaScriptIndicatorNameATR;
				IsSuspendedWhileInactive	= true;
				Period						= 14;

				AddPlot(Brushes.DarkCyan, Custom.Resource.NinjaScriptIndicatorNameATR);
			}

Here’s an example of how I have setup the builtin ATR indicator as an analyzer column.

1 Like