Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Hiding Drawing objects

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hiding Drawing objects

    Can one Hide Drawing objects in the properties section for an indicator?

    #2
    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.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thank you I understand about hiding with boolean, but if i right click a drawing object it will show the list of all the drawing object tag names. I want to hide all the tag names.

      Comment


        #4
        Hello ballboy11,

        This would not be possible however I will submit a feature request for this.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          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


            #6
            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.

            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
            
                }
            Please let us know if we may be of further assistance to you.

            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 Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            574 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X