Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Set height of inidcator panel

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

    Set height of inidcator panel

    Hi there,

    is there any way to constrain the height of an indicator panel programatically?

    I've got a whole bunch of indicators on my strategy that don't require much height. They're just green/red/yellow strips for various buy/sell/flat signals I'm working with. When I start my strategy these panels are granted about 75% of the available chart space, with the main-panel getting the remaining 25%.

    During development, I am Tweaking, Rebuilding & restarting my strategy loads of times per day and I am wasting so much time resizing panels.

    thanks,

    #2
    Hello kevinenergy,

    Thank you for the post.

    Unfortunately, the ChartPanel object's H property is read-only. This can't be set programmatically. I will submit a feature request to add the ability to set this property through a NinjaScript object.

    Thanks in advance for your patience.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Yes please do submit a feature request - and also point out that people have been waiting for this feature for over 11 years!! The first posts on this subject I found are 2007/2008



      Comment


        #4
        Hello kevinenergy,

        Thank you for the reply.

        I will add all of these links to my report to let our product management team know of the demand for this feature.

        Thank you for the suggestion, please let me know if I can assist further.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hello kevinenergy,

          I have the feature tracking ID for this item. I also added three votes to it for the three users that have requested this.

          SFT-3698

          You may check the release notes upon future updates to track new features:


          Please let me know if I can assist further.
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            What is the current status of this 11 year-old request?

            Comment


              #7
              Hi EminiTrader, thanks for the follow up. This feature request is still pending. The release notes will include all added feature request, so if you do not see it in there, it means the development team has decided to not include the feature in that particular update.

              Kind regards,
              -ChrisL
              Chris L.NinjaTrader Customer Service

              Comment


                #8
                I see this as necessary for several reasons. One of which being there are times (for reasons that I cannot isolate) that the workspace does not accurately save the panel height and it must be adjusted manually.

                Comment


                  #9
                  Add my vote as well. And multiply it by infinity, so it would be implemented rather sooner than later.

                  Comment


                    #10
                    I would like to have this feature too.

                    Comment


                      #11
                      Hello Bidder, UltraNIX, and Bobin,

                      Thanks for your notes.

                      Your votes have been added.

                      Let us know if we may assist further.
                      Brandon H.NinjaTrader Customer Service

                      Comment


                        #12
                        There is a really simple solution:
                        Code:
                        ChartControl.RowDefinitions.First().Height = new GridLength(100, rowDefinition.Height.GridUnitType);
                        Keep in mind that 100 is not a value in pixels but relative to the other grid lengths.

                        Comment


                          #13
                          Thanks for sharing!


                          Originally posted by Bobin View Post
                          There is a really simple solution:
                          Code:
                          ChartControl.RowDefinitions.First().Height = new GridLength(100, rowDefinition.Height.GridUnitType);
                          Keep in mind that 100 is not a value in pixels but relative to the other grid lengths.

                          Comment


                            #14
                            You are on your own here, this WPF stuff is not code that is going to be NT supported
                            So experiment in a test environment & code responsibly


                            Building on what Bobin​ has discovered:

                            Each panel on a chart tab uses two rows in ChartControl.RowDefinitions.
                            The even numbered rows are displayed, the odd numbered rows are spacers
                            Row 0 is the always the chart and row 1 is its spacer
                            If there are indicators they begin in row 2. So row 2 is an indicator and row 3 is its spacer and so on.

                            This can be called from OnRender() but it only needs to be called once
                            Other locations may work I didn't test for that scenario.

                            Code:
                            //class level vars
                            bool ResizeHeight;
                            
                                private void ReSizePanels(int RowHeightInPixels)
                                {
                                    if (ResizeHeight) return;
                            
                                    int MaxRows=ChartControl.RowDefinitions.Count;
                                    if (MaxRows<2) return;
                            
                                    for (int i=2; i<MaxRows; i++)
                                    {
                                        if (i%2==0) ChartControl.RowDefinitions[i].Height = new GridLength(RowHeightInPixels, GridUnitType.Pixel);  
                                    }
                            
                                    ResizeHeight=true;
                                 }
                            ​

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by mbafelfel, 05-05-2017, 06:12 AM
                            5 responses
                            1,367 views
                            0 likes
                            Last Post Rancher
                            by Rancher
                             
                            Started by Blaze212, 07-07-2024, 08:58 PM
                            3 responses
                            23 views
                            0 likes
                            Last Post Blaze212  
                            Started by yertle, Today, 12:24 PM
                            0 responses
                            4 views
                            0 likes
                            Last Post yertle
                            by yertle
                             
                            Started by reekotubbs, Yesterday, 01:09 PM
                            3 responses
                            28 views
                            0 likes
                            Last Post reekotubbs  
                            Started by medicmiked, Today, 11:56 AM
                            0 responses
                            9 views
                            0 likes
                            Last Post medicmiked  
                            Working...
                            X