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

    #16
    Hello,

    Thank you for the reply.

    To change the position of where items are placed in the panel, you would need to utilize the Column and Row definitions to position your item in the layout grid.

    You can see this is done in the sample in the method InsertWPFControls

    a new column is added to the right of MainTabControl and all items to the right of the MainTabControl are shifted to the right to account for that item. To change this to the left would require that you change this logic to shift the MainTabControl and everything else to the right. You would also need to adjust the logic in RemoveWPFControls to account for the change.

    The width is controlled in the line below this comment:

    Code:
    // a new column is added to the right of MainTabControl
    chartGrid.ColumnDefinitions.Insert((tabControlStartColumn + 1), new System.Windows.Controls.ColumnDefinition() { Width = new GridLength([B]125[/B]) });
    You are controlling the width of the Column you define which is later inserted in the grid.
    In case these concepts are difficult to visualize, these are standard WPF concepts related to Grids which there are many tutorials for online.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #17
      Hello Jesse,
      Thanks for the quick response. While changing the width of the added panel can be achieved easily as per your suggestion, placing the panel on the left side of the NT chart proves to be rather difficult. Setting chartGrid to HorizontalAlignment.Left resulted in pushing both the NT chart and added panel to the left side of the canvas with a wide area of transparent canvas on the right.
      Anyways, having the panel buttons on the right side of the charts does not look so bad any more.

      Comment


        #18
        menu items appearing in the chart menu at top

        Hello, In reference to the ChartCustomToolBarExample ; i based my code from some of this structure a while back.

        And i have various menu items appearing on the main menu for certain tabs where a specific indicator is loaded.

        This works well in general ; however when i start ninja (without a connection / or with a connect on startup) it seems all the menus items for each of the tabs (where the indicator is loaded) all appear along the top menu bar of the chart. Until i select a tab then the others clear and i now only have the menu items for the selected tab in focus.

        Is there something i additionally need to do in order to Not have all the items appear when starting. Is it the case when starting ninja with multiple tabs in a chart no tab has been selected so it is not clear which items to make invisible which is handled in the tab selection handler ?

        thanks

        Comment


          #19
          Hello soulfx,

          To confirm you are testing the script found here:
          Hello All, Moving forward this will be maintained in the help guide reference samples and no longer maintained on the forum. Creating Chart WPF (UI) Modifications from an Indicator - https://ninjatrader.com/support/help...ui)-modifi.htm (https://ninjatrader.com/support/helpGuides/nt8/creating-chart-wpf-(ui)-modifi.htm) I've


          I am not able to reproduce this behavior. Below is a link to a video I have recorded using 8.0.9.0 testing the indicator added to multiple tabs, as well as a tab with no indicator, and starting with and without connect on startup.
          Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


          Using the example script, with the steps taken in the video, are you experiencing different behavior than what is shown in the video?
          Last edited by NinjaTrader_ChelseaB; 10-18-2017, 02:55 PM.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            Thanks for checking, I will recheck and test on my end

            Comment


              #21
              Hello, so i reloaded this indicator above and note that this format is now different in anycase that you have stacked the menu. I am not nor wanting to stack and my menu items appear along the main chart menu at the top. I have gone through the code to check why they appear all at once on startup but then when a tab is selected it is only visible for the selected tab henceforth (the correct behaviour)
              On startup is historical state cycled twice or at least more than oncek checking the help guide it indicates it can be ? I do have a check with a boolean to mark if my toolbar menu is added in the historical state before going into the dispatch .....
              Do you still have the version of your example that has been updated like this one which doesnt stack ie just adds to the main chart menu at the top?

              So to confirm in running your example when i startup i only see the menu item for one tab. I see there is a tabselected check .... in the prior version it uses the

              ////Make sure we are visible on all tabs
              foreach (System.Windows.Controls.TabItem currentTab in _chartWindow.MainTabControl.Items)
              {
              if ((currentTab.Content as ChartTab).ChartControl == ChartControl && currentTab == _chartWindow.MainTabControl.SelectedItem)
              {
              _xxA.Visibility = System.Windows.Visibility.Visible;
              _xxB.Visibility = System.Windows.Visibility.Visible;
              _xxSeparator.Visibility = System.Windows.Visibility.Visible;
              _xxP.Visibility = System.Windows.Visibility.Visible;
              }
              }

              i dont see this in your code anywhere now


              thanks
              Last edited by soulfx; 10-23-2017, 11:58 AM.

              Comment


                #22
                Hello soulfx,

                Are you stating that the examples I have created are adding multiple buttons to the toolbar?

                What is the issue you are reporting with the example I have created?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #23
                  Hello, did you read my Post ? i had some clear questions?

                  I did not state there were issues with your example i said it was different to the original where the menu items are NOT stacked but added to the main menu at top alongside to the right of indicator panel / data series etc.

                  Yes yours appears correct BUT it is a different approach with stacked and a side panel

                  I am running ChartCustomToolBarExample.

                  Does the version exist you had prior where it included the sample of code above to make Visible which is where i based it upon?

                  I am trying to follow the logic as i stated to understand why they would all appear on the top menu on startup this is I made clear in my questions ;

                  If you are saying you scrapped the previous example and this is now the approach then please make that clear?

                  thanks

                  Comment


                    #24
                    Hello soulfx,

                    I am unsure of the issue..

                    I have updated the scripts to only show on the tab they are applied to.

                    What is the issue I can assist you with?

                    When you mention "where it included the sample of code above to make Visible which is where i based it upon" can you clarify what you are asking for?
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #25
                      Hello, OK i will email you directly and take this offline - you are wasting time here with your responses and vagueness and i have unfortunately experienced this before with you - are you having a bad day?
                      For the record does someone internally monitor these posts .. as to how ninja can improve customer service ? because this is not helpful and i can sense it in your replies.

                      Comment


                        #26
                        Hello soulfx,

                        I am not able understand what you are asking or requesting.

                        I am not able to find a direct question that I can answer in your posts.

                        Can you highlight this for me?
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #27
                          Hello, can you please advise which style should be used on the menu items to draw a tick mark (like e.g. Drawing tool > Snap mode)? When creating NTMenuItem with IsCheckable = true and style "InstrumentMenuItem", the menu item draws a pin instead of a tick mark. Thank you.

                          Comment


                            #28
                            Hello mantak007,

                            I used a geometry path when attempting this in an indicator with a menu.

                            Below is a link.
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #29
                              Have any of these examples been updated? I notice with the Custom Chart Trader Buttons that as I switch back and forth between tabs extra buttons appear. They seem to be abandoned and have no functionality but still exist on the Chart Trader and won't go away. I'm assuming there is a bug in the sample code.

                              Comment


                                #30
                                Hello RandomTask,

                                Are you referring to the chart modification indicators from the link below?

                                Hello All, Moving forward this will be maintained in the help guide reference samples and no longer maintained on the forum. Creating Chart WPF (UI) Modifications from an Indicator - https://ninjatrader.com/support/help...ui)-modifi.htm (https://ninjatrader.com/support/helpGuides/nt8/creating-chart-wpf-(ui)-modifi.htm) I've


                                Yes, these have been updated to be visible for the tab they are added to only.
                                Chelsea B.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Barry Milan, Yesterday, 10:35 PM
                                4 responses
                                15 views
                                0 likes
                                Last Post Barry Milan  
                                Started by DanielSanMartin, Yesterday, 02:37 PM
                                2 responses
                                13 views
                                0 likes
                                Last Post DanielSanMartin  
                                Started by DJ888, 04-16-2024, 06:09 PM
                                4 responses
                                12 views
                                0 likes
                                Last Post DJ888
                                by DJ888
                                 
                                Started by terofs, Today, 04:18 PM
                                0 responses
                                11 views
                                0 likes
                                Last Post terofs
                                by terofs
                                 
                                Started by nandhumca, Today, 03:41 PM
                                0 responses
                                8 views
                                0 likes
                                Last Post nandhumca  
                                Working...
                                X