Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Hiding Drawing objects
Collapse
X
-
Hello ballboy11,
Thank you for your note.
Within the properties section of an indicator you can set visible to false, which will hide the indicator from the chart, however there is no default option to hide only the drawing objects.
You could easily create a user input bool which would draw or not draw drawing objects, which you could toggle on or off from the indicator properties dialog.
I put together a sample script.
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
-
Has ninja implemented this? how do I hide all drawing objects on my chart and also hide all indicators? anyway at all possible to perform this task without deleting them all? Thanks,
Comment
-
Hello 3d2t.trading
Thank you for your reply.
This has not as of yet been implemented. However, you could create an indicator or addon that could hide your drawing objects and indicators. Here's a quick example. Note that in this case, to turn everything back to visible, you would need to check this indicator's visible toggle as well as uncheck MakeInvisible for the objects to be made visible again. You could use a similar approach in an add on that adds a button to the chart instead if you like.
Please let us know if we may be of further assistance to you.Code:public class VisibleToggle : Indicator { protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"Enter the description for your new custom Indicator here."; Name = "VisibleToggle"; Calculate = Calculate.OnBarClose; IsOverlay = true; DisplayInDataBox = true; DrawOnPricePanel = true; DrawHorizontalGridLines = true; DrawVerticalGridLines = true; PaintPriceMarkers = true; ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right; //Disable this property if your indicator requires custom values that cumulate with each new market data event. //See Help Guide for additional information. IsSuspendedWhileInactive = true; MakeInvisible = false; } else if (State == State.Configure) { } } protected override void OnBarUpdate() { if (MakeInvisible == true) { foreach (DrawingTool draw in DrawObjects.ToList()) { draw.IsVisible = false; } foreach (Indicator indi in ChartControl.Indicators.ToList()) { indi.IsVisible = false; } } else if (MakeInvisible == false) { foreach (DrawingTool draw in DrawObjects.ToList()) { draw.IsVisible = true; } foreach (Indicator indi in ChartControl.Indicators.ToList()) { indi.IsVisible = true; } } } #region Properties [NinjaScriptProperty] [Display(Name="MakeInvisible", Order=1, GroupName="Parameters")] public bool MakeInvisible { get; set; } #endregion }
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
648 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 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
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
574 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment