i have to blank out the indicator name in the dialog because i can't stomach the text mess at the top of the chart but i still need the indicator name in case there's an error in the log that needs to be run down... right now the log errors don't list the indicator because the name space is blanked out for visual sanity... thanks in advance...
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
indicator name on chart transparent
Collapse
X
-
indicator name on chart transparent
is there any way to make the indicator names transparent on the chart so that they can be enabled for error tracing but not clutter up the chart pane ?
i have to blank out the indicator name in the dialog because i can't stomach the text mess at the top of the chart but i still need the indicator name in case there's an error in the log that needs to be run down... right now the log errors don't list the indicator because the name space is blanked out for visual sanity... thanks in advance...Tags: None
-
Hi stafe, thanks for posting. The only way to remove the Indicator label is from the Name property or override the DisplayName property. You can put your code in try/catch blocks to write your own custom logs if an exception is thrown, that would be the only alternative option, or write the Name while debugging.
Kind regards,
-ChrisL
-
stafe
If this helps.
As an example I created a copy of the NT8 EMA indicator and added the code for what you want to chose to display or not the indicator name.
I've attached it as "EMA No Label NT8.zip" so you can view the code for yourself.
It's best to first make a copy of the indicator/s you want to edit the code for.
You can always delete the original once you know you've added the code correctly.
Open your indicator via the Control Centre:
New > Ninja Script Editor
Find your indicator in right pane and double click to open it.
Once open then right click anywhere in blank area > Save As and give it a name.
Once this newly named version is open you can apply the following code.
Once you're satisfied and it compiles without error you can use the newly named indicator and or apply the code to the original and delete the new one. Which ever.
It's not complicated.
Just add three bits of code:-
1.
In OnStateChange I added:-
Note: I set this to "false" so saves unticking the box..(see below)Code:DisplayIndicatorName = false;
2.
Just above OnBarUpdate I added:-
Code:public override string DisplayName { get { if (State == State.SetDefaults) return Name; else if (DisplayIndicatorName) return Name; else return ""; } }
3.
In Properties I added:-
Note: you can chose the GroupName for where in the indicator dialog the tick box will appear. ie "Setup" and you can type in your own Display Name ie: "Show Indicator Name"Code:[NinjaScriptProperty] [Display(Name="Show Indicator Name", Description="Draw a symbol to mark change in direction", Order=1, GroupName="Setup")] public bool DisplayIndicatorName { get; set; }
The whole code:
Code:public class EMANoLabel : Indicator { private double constant1; private double constant2; protected override void OnStateChange() { if (State == State.SetDefaults) { Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDe scriptionEMA; Name = "EMANoLabel"; IsOverlay = true; IsSuspendedWhileInactive = true; Period = 14; [COLOR=#16a085][B]///added Display name[/B][/COLOR] [B]DisplayIndicatorName = false;[/B] AddPlot(Brushes.Goldenrod, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNa meEMA); } else if (State == State.Configure) { constant1 = 2.0 / (1 + Period); constant2 = 1 - (2.0 / (1 + Period)); } } [COLOR=#1abc9c][B]///added Display Name[/B][/COLOR] [B]public override string DisplayName { get { if (State == State.SetDefaults) return Name; else if (DisplayIndicatorName) return Name; else return ""; } }[/B] protected override void OnBarUpdate() { Value[0] = (CurrentBar == 0 ? Input[0] : Input[0] * constant1 + constant2 * Value[1]); } #region Properties [Range(1, int.MaxValue), NinjaScriptProperty] [Display(ResourceType = typeof(Custom.Resource), Name = "Period", GroupName = "NinjaScriptParameters", Order = 0)] public int Period { get; set; } [B][COLOR=#16a085]///Display Indicator Name[/COLOR][/B] [B][NinjaScriptProperty] [Display(Name="Show Indicator Name", Description="Draw a symbol to mark change in direction", Order=1, GroupName="Setup")] public bool DisplayIndicatorName { get; set; }[/B] #endregion }
You'll then get a box you can tick to display or untick to not display the indicator name on the chart:
Hope that helpsLast edited by dj22522; 06-20-2023, 07:52 AM.
- Likes 3
Comment
-
Hi dj22522,
Thank you very much for take your time and share this useful code and all the details!!!
This is very useful for some of us like me.
I really appreciate this content!!!
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
639 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
366 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
107 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
569 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
572 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment