Feature request: toggle on/off displaying of the indicator names

For some reason, there’s no easy way to toggle display of names/labels of indicators on the chart. Please consider adding it.

Right now I have to resort to a script to add name override to all of the indicators which feels very 1990 :rofl:

# CONFIGURATION
$targetDir     = "C:\Path\To\NinjaScripts"     # <--- Set this
$logFile       = "C:\Path\To\insertion_log.txt"
$dryRun        = $false                        # $true = no changes; just preview
$recursive     = $true                         # Set to $false to disable subfolder scanning

$backupRoot    = "C:\Path\To\Backups"          # <--- Set backup storage directory
$timestamp     = Get-Date -Format "yyyyMMdd_HHmmss"
$zipName       = "NinjaScript_Backup_$timestamp.zip"
$zipPath       = Join-Path $backupRoot $zipName

$methodToInsert = @'
        public override string DisplayName
        {
          get { return ""; }
        }

'@

# Ensure backup path exists
if (-not (Test-Path $backupRoot)) {
    New-Item -ItemType Directory -Path $backupRoot | Out-Null
}

# Create ZIP backup
"Creating ZIP backup: $zipPath"
Compress-Archive -Path $targetDir -DestinationPath $zipPath -Force
"Backup complete.`n" | Out-File $logFile

# Start log
"--- Log started: $(Get-Date) ---" | Out-File $logFile -Append

# File search settings
$searchParams = @{ Path = $targetDir; Filter = "*.cs" }
if ($recursive) { $searchParams['Recurse'] = $true }

# Process files
Get-ChildItem @searchParams | Where-Object {
    $_.Name -notlike '@*' -and $_.PSIsContainer -eq $false
} | ForEach-Object {
    $file = $_.FullName
    $content = Get-Content $file
    $joinedContent = $content -join "`n"

    # Skip if already inserted
    if ($joinedContent -match "public override string DisplayName") {
        "SKIPPED (already inserted): $file" | Out-File $logFile -Append
        return
    }

    $newContent = @()
    $inserted = $false

    for ($i = 0; $i -lt $content.Count; $i++) {
        $line = $content[$i]
        if (-not $inserted -and $line.Trim() -match '^protected override void OnStateChange\s*\(\s*\)') {
            $newContent += $methodToInsert
            $inserted = $true
        }
        $newContent += $line
    }

    if ($inserted) {
        if ($dryRun) {
            "DRY-RUN (would insert): $file" | Out-File $logFile -Append
        } else {
            Copy-Item $file "$file.bak"
            $newContent | Set-Content $file
            "INSERTED: $file" | Out-File $logFile -Append
        }
    } else {
        "NO MATCH FOUND: $file" | Out-File $logFile -Append
    }
}
2 Likes


You can just leave the Label blank. This will prevent the name to display on the chart.

2 Likes

It’s tedious to do that every time one adds/removes an indicator. Also, if you erase the label - you have to type it back in if you need it again.

The latest version of NT8 finally got the search field - so we have some progress towards 21st century which makes me optimistic.

1 Like

Re: tedious to do every time - Save indicator Template with no Label as Default, then when add new instance of indi, it will have no Label

Hope this helps

3 Likes

Something I noticed after removing the labels: I can no longer see when the indicator is (calculating…)

FWIW I don’t think the two are likely related insofar as I’ve been removing labels in this manner forever and have always been able to see ‘(Calculating….)’ so I’d look elsewhere
Simple test of course, load indicator with and without Label different charts same instrument side-by-side
Good luck!

Label Remover. Just add it to your chart and it’ll remove all labels.

https://nexusfi.com/local_links.php?linkid=2457

2 Likes

Thanks. AFAIK you have to pay to download from that forum (plus I don’t install third party dll files on my system).

Anyway, I think I figured out how to program a toggle using shared variables and name override:

https://forum.ninjatrader.com/forum/historical-beta-archive/version-8-beta/86475-how-to-avoid-file-errors-using-streamwriter-on-multiple-instrument-backtest#post733956

The file I linked to isn’t a DLL, it’s an indicator. And only the files in the “elite” section require a paid membership to download.

Unless NinjaTrader implements this (maybe in another ten years), this is probably the best solution.

2 Likes

Honestly, I don’t know why they make it so hard to deal with indicators.

The fact you cannot:

A) Hide all indicators
B) Easily hide individual indicators

Is hard to understand. I’m sure they can do it.

Right Click > Indicators > Find indicator > scroll down > uncheck Visible > Click Apply.

Repeat for every indicator if you want to hide them all. The names on the top of the chart wouldn’t be an issue if you could click on them to hide the indicator.

A while back I subscribed to that forum to download some indicator only to find out it was for paid members only. I felt like it was a beit-and-switch (maybe I did not read the fine print) and I deleted my account soon after. TL;DR I’m not going back to that forum. :grinning_face:

easiest way, delete the label and save it as default

There are a bunch of indicators on the ecosystem that will do this - here is mine for instance. Its not perfect but 99% ;-). Please do read the notes before using it which are at the top of the code.

1 Like

New ninjatrader version offers an option to hide all indicators which is a step in the right direction. Unfortunately, hiding indicators does not hide their description!

Is there a way to hide the descriptions via indicator/addon?

I might be being dim here but you want to remove the descriptions? Ones that sit at the LHS top of the chart? Your script will obviously do that so what else are you trying to achieve?
If it’s the label you want changing then look at DisplayName property but from your code i assume you are way beyond that. So maybe some further clarification would help.

The Right Click > Show Indicators Implementation is a bit strange. It neither unloads the indicators, nor toggles their visibility but something else, which is why the labels stay in the top left

Since using NT I do not understand why they do not introduce better indicator management, the framework is there to allow the users to easily turn on/off individual indicator via a singular menu or control. However, to this day the best they can come up with is:

  • All on/off
  • Turn off individual = Right click > Indicators > find indicator > scroll down > uncheck visible > click apply.

Regard the labels. It’s simply a case of looping through the indicator list and setting Indicator.Name to blank.

There’s 3 fields related to the Name.

.Name
.DisplayName
.DisplayNameTemplate

If I remember they interact with each other in a strange way, .DisplayNameTemplate is the only one that is consistent and is never blank or null.