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

    Hello Unsuitable,

    It would be possible.

    You would need to remove the code of event handlers assigned to the buttons, the buttons, the code that adds / removes the grid column and the code that sets the column of the leftInnerGrid, as well as the leftInnerGrid.

    When you say it's breaking, do you mean you are getting errors?

    What are the errors?
    Chelsea B.NinjaTrader Customer Service

    Comment


      Well, I'd remove the parts containing the left grid code and the chart goes black. Then when keeping that code in but removing select parts, each refresh of the indicators increases the left side margin indefinitely. It's quite frustrating.
      Unsuitable
      NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

      Comment


        Hello Unsuitable,

        The grid columns are changed on lines 326 - 344, 378 - 379, and 391 - 392.

        Have you also removed this code that changes the columns?

        Chelsea B.NinjaTrader Customer Service

        Comment


          Here's the file I'm currently working on. Line 299 sort of fixes the problem but a lot of the left tool bar code remains.

          ColorToolbar.zip
          Unsuitable
          NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

          Comment


            Hello Unsuitable,

            In your script the code for changing the columns is still there on lines 299 - 306, and 313.
            Chelsea B.NinjaTrader Customer Service

            Comment


              Doing so messes with the top toolbar by moving it down halfway down the chart.


              Unsuitable
              NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

              Comment


                Hello Unsuitable,

                Are you modifying the rows as well, or just the columns?

                The exact code you have posted in post #110 is causing that behavior?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  Honestly, I've been going back and forth trying to fix it that I'm not too sure what was left in and what wasn't when #112 occurred. Getting tired of going back and forth with the code, I have to create a new chart every time as the bugs can be permanent to that chart. Is there any resource you could point me to that only has to top toolbar? I tried googling it but no luck on the proper tutorials.
                  Unsuitable
                  NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

                  Comment


                    Hello Unsuitable,

                    I had inquiries where developers have used this example and just used the top toolbar and removed all of the grid column changing code, but I'm not sure if their scripts were publicly posted or what the name would be.

                    These indicators were meant to be a learning tools to learn how to manipulate grids so that developers can understand how changing WPF grids works and develop their own custom logic for their scripts, than meant to be something that is copied and pasted into another script.

                    This thread will remain open for any community members that would like to share a script with only a toolbar at the top.

                    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our NinjaTrader Ecosystem team follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      Yes, I would like that. I've made a toolbar using the toolstrip for NT7 in past and I'm trying to port it over. Thought it would be simple, but I guess not. All I really need is a top toolbar with one button. The rest of the functionality I can figure out on my own.


                      Click image for larger version

Name:	2020-09-17_12-55-57.gif
Views:	696
Size:	754.5 KB
ID:	1118672
                      Unsuitable
                      NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

                      Comment


                        Hi Unsuitable,
                        Are you just looking for functional buttons on the edge of the chart screen? Please see attached chart screen.
                        If so, I could provide you with related codes, which are all from Ninjatrader samples.

                        Chart_buttons_lq.pdf

                        Comment


                          Hello,

                          This is Chris following up on behalf of Chelsea. Chelsea wanted me to provide you with information about third-party NinjaScript programming consultants.

                          You can search our list of NinjaScript consultants through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more:You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third-party services for NinjaTrader, all pricing and support information will need to be obtained through the consultant.

                          The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem, LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

                          Let me know if I may be of further assistance.

                          Comment


                            Hi Chelsea

                            I have used your code Custome Chart trading buttons ( thank you) - I am trying to add a row(column?) to add another couple of buttons but I am failing.
                            As I see it I need to add another grid,

                            Code:
                                 lowerButtonsGrid = new System.Windows.Controls.Grid();
                            System.Windows.Controls.Grid.SetColumnSpan(lowerButtonsGrid, 4);
                            lowerButtonsGrid1.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition());
                            lowerButtonsGrid1.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition() { Width = new GridLength((double)Application.Current.FindResourc e("MarginBase")) });
                            lowerButtonsGrid1.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition()););
                            so I am unsure of the number at the end here ( the number 4) - what does it refer to?

                            then I add it as a new row?

                            Code:
                             addedRow3 = new System.Windows.Controls.RowDefinition() { Height = new GridLength(31) };
                            then I just increase the array of buttons by 2 ( simple)
                            but then comes the bit I am definitely not understanding

                            Code:
                             System.Windows.Controls.Grid.SetColumn(buttonsArray[4], 0);
                            System.Windows.Controls.Grid.SetColumn(buttonsArray[5], 2);
                            add a new row to the existing buttons grid?

                            Code:
                             chartTraderButtonsGrid.RowDefinitions.Add(addedRow 3);
                            What I get is 4 buttons - it misses out or doesn't produce buttonsArray{0] and [1].

                            Any pointers much appreciated.


                            Comment


                              Hello Mindset,

                              You can add a row to the lowerButtonsGrid. That grid already exists.
                              You can add the buttons to the lowerButtonsGrid.

                              The added buttons can be set to the second row of the lowerButtonsGrid with System.Windows.Controls.Grid.SetRow() using the lowerButtonsGrid.
                              Chelsea B.NinjaTrader Customer Service

                              Comment


                                Ok I can move buttons up and down the lower grid now using
                                [CODE] chartTraderGrid.RowDefinitions.Add(addedRow3);
                                System.Windows.Controls.Grid.SetRow(lowerButtonsGr id, (chartTraderGrid.RowDefinitions.Count +1));
                                chartTraderGrid.Children.Add(lowerButtonsGrid);/[CODE]

                                but I still only get 4 buttons. I read this as adding 2 buttons to the top grid and 4 buttons to the lower grid - is this correct or what am i getting wrong

                                Code:
                                for (int i = 0; i < 2; ++i)
                                upperButtonsGrid.Children.Add(buttonsArray[i]);
                                for (int i = 2; i < 6; ++i)
                                lowerButtonsGrid.Children.Add(buttonsArray[i]);
                                This line I dont' understand and maybe that's where my issue is

                                Code:
                                System.Windows.Controls.Grid.SetColumn(buttonsArra y[4], 0);??
                                Last edited by Mindset; 09-23-2020, 10:10 PM.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by yertle, Yesterday, 08:38 AM
                                7 responses
                                28 views
                                0 likes
                                Last Post yertle
                                by yertle
                                 
                                Started by bmartz, 03-12-2024, 06:12 AM
                                2 responses
                                21 views
                                0 likes
                                Last Post bmartz
                                by bmartz
                                 
                                Started by funk10101, Today, 12:02 AM
                                0 responses
                                5 views
                                0 likes
                                Last Post funk10101  
                                Started by gravdigaz6, Yesterday, 11:40 PM
                                1 response
                                9 views
                                0 likes
                                Last Post NinjaTrader_Manfred  
                                Started by MarianApalaghiei, Yesterday, 10:49 PM
                                3 responses
                                11 views
                                0 likes
                                Last Post NinjaTrader_Manfred  
                                Working...
                                X