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 petrovna,

    Welcome to the NinjaTrader forums!

    Are you adding the SampleWPFModifications reference sample to the chart in the Indicators window in the Configured area?
    Chelsea B.NinjaTrader Customer Service

    Comment



      Hello, would you be so kind to help me, I need to add a selectable Boolean box and an image to the chart trader, and it is very difficult for me, seeing the experience you have, I wonder if it would be possible

      Comment


        Hello RubenCazorla,

        For a bool you will want to add a CheckBox. Consider the .IsChecked property as the bool for true or false.
        https://docs.microsoft.com/en-us/dot...owsdesktop-6.0

        Below is a link to an example addon that uses a CheckBox element.
        https://ninjatrader.com/support/foru...egy#post759830

        See lines 242 through 265 in the SampleWPFModifications reference sample for sample code on adding an image.
        https://ninjatrader.com/support/help...ui)-modifi.htm
        Chelsea B.NinjaTrader Customer Service

        Comment


          SampleWPFModifications.zip not avaliable, page not found

          Comment


            ok solved, now i need more help, need ad a toolbox to select orderqty for a strategy, cand sow a example like a same toolbox of chart trader order qty? TY
            Last edited by RubenCazorla; 07-08-2022, 08:50 AM.

            Comment


              Originally posted by RubenCazorla View Post
              ok solved, now i need more help, need ad a toolbox to select orderqty for a strategy, cand sow a example like a same toolbox of chart trader order qty? TY
              Check this thread it should be helpful.
              QuantityUpDown Control - NinjaTrader Support Forum

              Comment


                Hello Everyone!

                Looks like I'm reviving an old thread but figured it is better asked here.


                I've modified the Chart Trader Template​ in order to fit multiple buttons in the lower part of the Chart Trader panel in a strategy.
                The goal was to make different sized buttons in different rows(different amount of columns). So for this example I made 2 different grids. This allows me to modify the 'Close' button to be 1 big button instead of having a bunch of small buttons. (See Pic Below)



                Everything seems to work as intended, unless I have the strategy enabled on multiple charts stored in TABS.
                It will move the top buttons(Buy/Sell) to the same row as the 'Close Position' Button.
                This only happens depending on which tab it's switched from. (See Video Below)
                World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


                It seems like when I switch to the older Tab (With the strat loaded) It Inserts everything to the lower grid. (Puts all buttons where the Close Position button is)
                I've gone through the example more times than I can count but I seem to come up short with a solution.

                I know it's not in your policy to find problems in the code. But if there is a way I could get a suggestion on where or how to handle this tab change.
                I'd be very grateful!

                I included the Zip file with the bare stripped down template.

                Thank you in advance!
                Attached Files

                Comment


                  I've used Chrome on both Win7 and Win11 but I can't see your image.

                  Can you try to attach it again?

                  Comment


                    For sure! Let me try uploading it this way.

                    The image is just of the chart trader template buttons (Same as in the video)
                    Just shows the 2 smaller buttons on top (Grid 1 with 2 columns)
                    Then 1 big button at the bottom (Grid 2 with 1 column)
                    Attached Files

                    Comment


                      Hello TradeSaber,

                      I would recommend that you remove the lowerButtonsGrid2 and add 1 additional row to lowerButtonsGrid, and set the columnspan on the objects to 2.

                      The SampleWPFModifications reference sample has a working example that does not reproduce this behavior.
                      https://ninjatrader.com/support/help...ui)-modifi.htm
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        Thank you so much for this example Chelsea!

                        I will have to sit down tonight and dissect this a bit.
                        The reason I added lowerButtonsGrid2 was so the 2nd row would be just 1 column rather than the 2.
                        (I can make it work when all the rows have the same number of columns. But I want some rows with different amount of columns)

                        It is very likely I'm just going about this the wrong way. WPF is not my strong suit at all.
                        I will play with this example you provided and see if I can make it work before asking any follow up questions!

                        Thank you again. Appreciate your help!

                        Comment


                          O such a pain in the booty to get this stuff setup

                          Comment


                            Finally got it working! Ended up outsourcing this part to someone more familiar with this.

                            I made this basic template with the fix, incase anyone in the future finds themselves looking for a similar Chart Trader Multi Grid example.

                            This is found under 'Strategies' because that is what I'm working with. Just copy and paste the code to an indicator if that is what you need.

                            Attached Files
                            Last edited by TradeSaber; 05-18-2023, 08:31 AM.

                            Comment


                              Love these names "ChartTraderControlQuickSellMarketButton" lol NinjaTrader_ChelseaB can i get a pamphlet with the names of all these ?

                              Comment


                                Hello Entwaze,

                                This would fall under undocumented. Modifying the NinjaTrader windows was not intentioned by the development team, but as it is WPF, our Engineering Support team has provided some examples of how this is possible.

                                Instead of providing a documented list of all automation ids, I can recommend using MSInspect to get any automation id you would like (for the most part).

                                Below is a link to a forum post that discusses.
                                Chelsea B.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by bortz, 11-06-2023, 08:04 AM
                                47 responses
                                1,605 views
                                0 likes
                                Last Post aligator  
                                Started by jaybedreamin, Today, 05:56 PM
                                0 responses
                                8 views
                                0 likes
                                Last Post jaybedreamin  
                                Started by DJ888, 04-16-2024, 06:09 PM
                                6 responses
                                18 views
                                0 likes
                                Last Post DJ888
                                by DJ888
                                 
                                Started by Jon17, Today, 04:33 PM
                                0 responses
                                4 views
                                0 likes
                                Last Post Jon17
                                by Jon17
                                 
                                Started by Javierw.ok, Today, 04:12 PM
                                0 responses
                                13 views
                                0 likes
                                Last Post Javierw.ok  
                                Working...
                                X