From 6df1d0d857ec14e3fb71b66c680bc57927548149 Mon Sep 17 00:00:00 2001 From: moshferatu Date: Mon, 18 Mar 2024 08:49:25 -0700 Subject: [PATCH] Display the chosen index name on the chart --- indicators/IndexTopN.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indicators/IndexTopN.cs b/indicators/IndexTopN.cs index 16aa169..ccdf893 100644 --- a/indicators/IndexTopN.cs +++ b/indicators/IndexTopN.cs @@ -136,7 +136,10 @@ namespace NinjaTrader.NinjaScript.Indicators public override string DisplayName { - get { return "Index Top " + NumComponents; } + get { + string indexName = (TrackingIndex == MarketIndex.NASDAQ) ? "NASDAQ" : "S&P 500"; + return indexName + " Top " + NumComponents; + } } #region Plots