Dynamic Property Visibility & Draw.Line Artifact in Custom Indicator

Hi everyone,

I’m developing a custom NinjaTrader 8 indicator that includes two internal calculation modes (strategies).
The indicator works well functionally — all drawing logic is stable — but I’m running into two persistent UI/visual issues I’d love to resolve cleanly.


:one: Property Visibility in the Indicator Settings Panel**

I want to dynamically show or hide certain input fields in the indicator’s property grid depending on which “strategy mode” the user selects (for example, showing “Event Date” and “Event Time” fields only when the Event-based mode is selected).

I’ve tried several approaches:

1- SetPropertyVisibility()** – this method appears to exist only in certain internal NinjaScript types; it’s not available to standard indicators.
2- Custom TypeConverter** – I successfully created a converter that filters the property list, but NinjaTrader’s UI doesn’t seem to refresh dynamically after the user switches strategy modes. It only updates if the indicator is reloaded.
3- OnPropertyChanged() and NotifyOfPropertyChange()** – neither appear to trigger a UI refresh when using [NinjaScriptProperty] decorated fields.

Question:
Is there a supported or reliable way to make indicator settings dynamically visible/invisible based on the value of another property (similar to conditional visibility in custom add-ons)?
Or is the settings panel built statically at load time, meaning this behavior isn’t supported for indicators?


:two: Vertical Line Artifact in Drawn VWAP Plot**

In my event-driven mode, I anchor a VWAP calculation to a specific bar (e.g., a known timestamp).
When the anchor is set, a Draw.Text and Draw.Dot are created to mark the event on the chart.

However, even though the VWAP calculation and plotting logic skip the anchor bar (using if (CurrentBar == eAnchorBar) return;), the chart sometimes displays a vertical line connecting the VWAP start point to the anchor bar.
This doesn’t affect the data or math, just the visual plot.

Things already tested:

  • Ensuring no NaN values before the anchor bar.
  • Resetting the first two bars’ plot values to double.NaN after anchoring.
  • Manually flattening the first two bars of the plot (no change).
  • Disabling interpolation or smoothing (no change).

The strange part:
The Session-based VWAP (which resets each RTH session) uses the same accumulation logic and does not display this vertical spike, but the event-driven one does — even though they share identical plotting code except for their anchor logic.

Question:
Is there a known chart-rendering behavior that causes a vertical line between a NaN and the first valid value on a plot line, even if the prior index is explicitly set to double.NaN?
And if so, is there a recommended workaround (like buffering one extra NaN or forcing Values[x][1] = Values[x][0] on anchor initialization)?


To recap:

  1. Looking for a supported way to dynamically hide/show indicator properties based on another property’s value.
  2. Trying to understand (and eliminate) a vertical line artifact on the chart when anchoring a plot dynamically mid-session.

Any insights, references, or examples from NinjaTrader’s team or other developers would be hugely appreciated.
I’m not asking for code review — just clarification on what’s supported by the NinjaTrader property grid and rendering engine.

Thanks in advance!

    [RefreshProperties(RefreshProperties.All)]

For 1, IndicatorBaseConverter is the best way I know. Sample code can be found at the web link below, but looks like you already may have done this.

https://ninjatrader.com/support/helpGuides/nt8/using_a_typeconverter_to_custo.htm

@several’s response above is what you need to get NT UI to refresh. This is what the complete input syntax looks like:

		[RefreshProperties(RefreshProperties.All)]
		[Display(GroupName="your group name", Order=1, Name="Show xyz")]
		public bool Input_ShowXYZ
		{ get; set; }

For 2, have you tried setting the plot color to transparent for the bar that has the first value? Alternately, you can try resetting the plot.

PlotBrushes[x][barsAgo] = Brushes.Transparent;

or

Values[x].Reset(barsAgo);
1 Like