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

Add buttons to existing Chart Toolbar

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

    Add buttons to existing Chart Toolbar

    Hello,

    Anyone have code snippets to add buttons (and events) to the existing Chart Toolbar?

    Like we used to do in NT7?

    (there is posted code to create a new virtual toolbar, but I'm looking for something simpler...)

    Thanks

    #2
    Hell vantojo,

    Thanks for your question.

    Please see the examples found below. I believe you will want to be looking for ChartToolBarCustomMenuExample.

    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


    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      here is a link to add Long Short Toolbar buttons to chart, but not chart trader



      I also know a coder who built me a customer indicator that adds buttons to my chart Trader if you dont figure it out. He stays pretty booked

      Comment


        #4
        https://ninjatraderecosystem.com/use...ers-and-wicks/

        I use this as example, pretty easy logic to build own buttons.

        Comment


          #5
          What I would like to do is add buttons to the existing chart toolbar and not add another toolbar...similiar to how we "used to do it" in NT7. Except now of course we have WPF.

          Comment


            #6
            Ok, the name threw me off...https://ninjatraderecosystem.com/use...ers-and-wicks/

            that looks like it uses the existing toolbar...thanks

            Comment


              #7
              I like to add a chart trader to my top bar, I have all my drawing tools on the left side of the chart so plenty room on top to have all chart trader info in there in small bottoms. Is that possible, that would be great.

              Comment


                #8
                Hello eddiekellertri,

                This is possible and the linked examples in post #2 will show how to perform any needed WPF modifications.

                Performing the same tasks as Chart Trader with your buttons can be done by finding the existing buttons by automation ID and then invoking the button presses by raising an event for the Button.ClickEvent of the button. Outside of a button (outside of UI thread) could be done through a dispatcher.

                From inside a custom button press (on UI thread)
                Code:
                if (modifyCtSellMarketButton != null)
                {
                    modifyCtSellMarketButton.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
                }
                The SampleWPFModifications example shows finding Buy and Sell market buttons using automation ID's in CreateWPFControls() for use case 6.

                Code:
                 modifyCtBuyMarketButton = chartTraderGrid.FindFirst("ChartTraderControlQuickBuyMarketButton") as Button;
                modifyCtSellMarketButton = chartTraderGrid.FindFirst("ChartTraderControlQuickSellMarketButton") as Button;
                Inspect from with Windows SDK can be used to find the automation ID's of each button on Chart Trader by opening inspect, and clicking the buttons on Chart Trader. You will find that that automation ID's are similar to the Buy and Sell market buttons.

                Download Inspect (publicly available link) - https://developer.microsoft.com/en-u...indows-10-sdk/

                You can then find the inspect.exe tool in C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64

                Let us know if there is anything else we can do to help.



                JimNinjaTrader Customer Service

                Comment


                  #9
                  This is what Im trying to do, can someone help/guide , I dont have many coding skills



                  Click image for larger version

Name:	screen-new-top.png
Views:	1555
Size:	248.3 KB
ID:	1169660
                  Attached Files

                  Comment


                    #10
                    Hello eddiekellertri,

                    WPF modifications are one of the more complex things you can do with NinjaScript, learning how to perform them requires getting your hands dirty and understanding what is done in the WPF modification examples.

                    The first step I would suggest would be to review the examples to see how you can add a toolbar and add buttons. This will likely be the most difficult task. Making your own script that adds a toolbar and buttons based off of the examples will be the best way to navigate that part.

                    After that, I would suggest adding your buttons and then to test invoking a one of the Sell Market or Buy Market buttons from your one button. You can reference the snippet I have provided in post #8 that shows invoking the Sell Market button. Note that you will have to find the button by automation ID (which is also demonstrated in the SampleWPFModifications example.)

                    After you get that button working, download the Windows SDK and use the Inspect tool to find the automation ID's for the other Chart Trader buttons. Then you would just have to wire up those remaining buttons.

                    This would be a bit more of a complex task for a new developer, but will be rewarding after you accomplish your goal.

                    If you instead are looking for services to have a script written for you that accomplishes this task, I can have a colleague chime in on NinjaScript Consulting services in our EcoSystem.

                    Please let us know if that is something that interests you.
                    Last edited by NinjaTrader_Jim; 08-31-2021, 10:04 AM.
                    JimNinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by vantojo View Post
                      What I would like to do is add buttons to the existing chart toolbar and not add another toolbar...similiar to how we "used to do it" in NT7. Except now of course we have WPF.
                      Just download and use mahToolBar6 indicator (link bellow). It will install all drawing tolls icons in the main toolbar, including Chart Trader and much more. You have the option to select any number of the 1-click icons to show in the main menu bar and save your chart space. Just read the description provided with indicator. I think this is what you are looking for here:

                      https://ninjatraderecosystem.com/use...-mahtoolbar-2/

                      Cheers!
                      Attached Files
                      Last edited by aligator; 08-31-2021, 12:16 PM.

                      Comment


                        #12
                        Originally posted by NinjaTrader_Jim View Post
                        Hello eddiekellertri,

                        WPF modifications are one of the more complex things you can do with NinjaScript, learning how to perform them requires getting your hands dirty and understanding what is done in the WPF modification examples.

                        The first step I would suggest would be to review the examples to see how you can add a toolbar and add buttons. This will likely be the most difficult task. Making your own script that adds a toolbar and buttons based off of the examples will be the best way to navigate that part.

                        After that, I would suggest adding your buttons and then to test invoking a one of the Sell Market or Buy Market buttons from your one button. You can reference the snippet I have provided in post #8 that shows invoking the Sell Market button. Note that you will have to find the button by automation ID (which is also demonstrated in the SampleWPFModifications example.)

                        After you get that button working, download the Windows SDK and use the Inspect tool to find the automation ID's for the other Chart Trader buttons. Then you would just have to wire up those remaining buttons.

                        This would be a bit more of a more complex task for a new developer, but will be rewarding after you accomplish your goal.

                        If you instead are looking for services to have a script written for you that accomplishes this task, I can have a colleague chime in on NinjaScript Consulting services in our EcoSystem.

                        Please let us know if that is something that interests you.
                        I don't think I have the time and the knowledge to do that so is any developer or someone like to help or offer services, please contact me

                        Comment


                          #13
                          Originally posted by aligator View Post



                          Just download and use mahToolBar6 indicator (link bellow). It will install all drawing tolls icons in the main toolbar, including Chart Trader and much more. You have the option to select any number of the 1-click icons to show in the main menu bar and save your chart space. Just read the description provided with indicator. I think this is what you are looking for here:

                          mahToolBar – Version 6 This version updates the code to includes several new icons for NT8 default Drawing Tools plus additional chart management tools. The mahToolBar6 indicator installs drawing tools icons in the NinjaTrader 8 Main Toolbar for a one-click drawing. The early version of this indicator with selected tools used sample scripts from several […]


                          Cheers!
                          That does not do what Im looking for at all

                          Comment


                            #14
                            Hello eddiekellertri,

                            Thank you for your post.


                            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.
                            Thomas C.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by kujista, Today, 05:44 AM
                            0 responses
                            5 views
                            0 likes
                            Last Post kujista
                            by kujista
                             
                            Started by ZenCortexCLICK, Today, 04:58 AM
                            0 responses
                            5 views
                            0 likes
                            Last Post ZenCortexCLICK  
                            Started by sidlercom80, 10-28-2023, 08:49 AM
                            172 responses
                            2,281 views
                            0 likes
                            Last Post sidlercom80  
                            Started by Irukandji, Yesterday, 02:53 AM
                            2 responses
                            18 views
                            0 likes
                            Last Post Irukandji  
                            Started by adeelshahzad, Today, 03:54 AM
                            0 responses
                            8 views
                            0 likes
                            Last Post adeelshahzad  
                            Working...
                            X