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

Modifications to chart WPF elements and tab considerations

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

    It was happening because I had 6 rows and 6 grids instead of 6 rows in 1 grid. I changed to one grid, issue got fixed

    Comment


      Hi Chelsea
      Me again. Still can't wrap my head around creating more buttons/grids.
      I followed your model and added a second lower grid (lower1buttonsgrid ) with a further 2 buttons

      Code:
      lower1ButtonsGrid.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition());
      lower1ButtonsGrid.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition() { Width = new GridLength((double)Application.Current.FindResourc e("MarginBase")) });
      lower1ButtonsGrid.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition());
      then I added a new row

      Code:
       addedRow3 = new System.Windows.Controls.RowDefinition() { Height = new GridLength(31) };
      then I put my buttons into the columns

      Code:
      System.Windows.Controls.Grid.SetColumn(buttonsArra y[4], 0);
      System.Windows.Controls.Grid.SetColumn(buttonsArra y[5], 2);
      for (int i = 4; i < 6; ++i)
      lower1ButtonsGrid.Children.Add(buttonsArray[i]);
      Then I added it to the InsertWPF method

      Code:
       if (chartTraderButtonsGrid != null || lower1ButtonsGrid != null)
      {
      chartTraderGrid.Children.Remove(lower1ButtonsGrid) ;
      chartTraderGrid.RowDefinitions.Remove(addedRow3);
      }
      but I get no buttons at all.
      Its so frustrating. User fawzanalim managed to kindly share his code with 12 buttons but that has issues when you reload ( it moves all the instrument and account details downwards underneath the new buttons upon reload).

      If you can help I would be most grateful.
      Attached Files
      Last edited by Mindset; 10-13-2021, 07:11 PM.

      Comment


        It contains 12 buttons. Haven't faced any issues so far. But my buttons are in the uppergrid, not lowergrid.
        Attached Files
        Last edited by fawzanalim; 10-13-2021, 10:46 PM.

        Comment


          Here's four buttons in the lowergrid
          Attached Files

          Comment


            Hello Mindset,

            Take one step at a time.

            First, are any errors appearing on the Log tab of the Control Center?

            Are the indexes used all correct and smaller than the size of the collection?

            Are the buttons being added to the proper columns in your custom grid?
            Chelsea B.NinjaTrader Customer Service

            Comment


              Hi Chelsea B

              Simple dumb error that #fawzanalim helped me solve. I had the wrong margins when setting the buttons - so buttons were written over each other or not at all etc! that only took a month to sort out.
              On with the next issue!

              Edit - code for 8 buttons provided here as raw material for anyone else having similar issues/ looking to learn
              Please note I have found in using it every now and again it won't load/fouls up - throw the chart away and use another one; works for me!
              Ps Chelsea, I get nothing in the logs when this happens.
              Attached Files
              Last edited by Mindset; 10-16-2021, 12:11 AM.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by RT001, Today, 05:07 PM
              0 responses
              5 views
              0 likes
              Last Post RT001
              by RT001
               
              Started by Bobin, Today, 02:47 PM
              1 response
              25 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Bobin, Today, 06:39 AM
              2 responses
              46 views
              0 likes
              Last Post jeronymite  
              Started by ezrollin, Today, 01:29 PM
              1 response
              36 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by vpatanka, Today, 09:25 AM
              1 response
              56 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X