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, 08: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, 11: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, 01:11 AM.

              Comment


                Hi

                YOur sample WPF code in help doesn't load button 1 to the left hand side toolbar - because there isn't a button 1!! FYI

                Comment


                  Hello Mindset,

                  Are you referring to toolbarTopMenuButton1 in the top tool bar or toolbarLeftMenuButton2 on the left toolbar?

                  There isn't anything named button1, but the first button is on the top tool bar.

                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    Hi Chelsea, Thank you for the amazing sample code. I took ChartCustomToolbarExample and modified to have only the top toolbar. I simply removed all the references to left*
                    to get rid off the left toolbar. It didn't work. I still get blank left toolbar. Any clues? TY!

                    Comment


                      Hello cay7man,

                      Is the menu still being created and added to the chart grid?
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        Originally posted by NinjaTrader_ChelseaB View Post
                        Hello cay7man,

                        Is the menu still being created and added to the chart grid?

                        For the top toolbar, Yes. Looks fine. Left bar is blank and couldn't be removed. I'm attaching the modified code...
                        Attached Files

                        Comment


                          Hello cay7man,

                          It's still adding a new column on line 223 and shifting columns on line 230.
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            Originally posted by NinjaTrader_ChelseaB View Post
                            Hello cay7man,

                            It's still adding a new column on line 223 and shifting columns on line 230.
                            Great! Its removed now. Not sure what I did before. I was adjusting the columns. TY!

                            Comment


                              Hi Chelsea,
                              Thanks for the sample code. I've been using it for awhile now. Everything seems to work properly, but I get this weird bug sometimes. All my buttons disappear except the last row. I tried to regenerate the bug a lot, but couldn't. It happens with any buttons. It's working fine, all of a sudden all the buttons are gone when I pressed a button. There is no log messages. In order to bring those buttons back, I have to remove the script and add it again. Any idea whats causing this issue?

                              Comment


                                Originally posted by Subhash Badri View Post
                                Still not working

                                I followed the exact steps like you suggested. I checked the custom\indicators folder and the file is present and I hope that confirms that import was successful.

                                I launch the chart but do not see any button controls.

                                I have the same issue man! did everything as yousaid and no changes.. what else can you suggest?

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by nandhumca, Yesterday, 03:41 PM
                                1 response
                                12 views
                                0 likes
                                Last Post NinjaTrader_Gaby  
                                Started by The_Sec, Yesterday, 03:37 PM
                                1 response
                                11 views
                                0 likes
                                Last Post NinjaTrader_Gaby  
                                Started by vecnopus, Today, 06:15 AM
                                0 responses
                                1 view
                                0 likes
                                Last Post vecnopus  
                                Started by Aviram Y, Today, 05:29 AM
                                0 responses
                                5 views
                                0 likes
                                Last Post Aviram Y  
                                Started by quantismo, 04-17-2024, 05:13 PM
                                3 responses
                                27 views
                                0 likes
                                Last Post NinjaTrader_Gaby  
                                Working...
                                X