Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modifications to chart WPF elements and tab considerations

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

    Originally posted by bltdavid View Post

    As part of the community, why not contribute the technique that you used?
    This could be very helpful to someone else someday.

    The concept at hand in the above quote was how to obtain automation id's...

    When working with anything WPF related let your hair grow back in and use the live visual tree in Vs2019 or Vs2022


    Click image for larger version

Name:	image.png
Views:	616
Size:	37.5 KB
ID:	1292908

    Comment


      Yes, that makes perfect sense. Good idea.
      Bruce DeVault
      QuantKey Trading Vendor Services
      NinjaTrader Ecosystem Vendor - QuantKey

      Comment


        Hello community.
        I'm looking for a way to place wpf/winform Control behind the ChartBars and any other ChartObject.
        UsercontrolCollection/ChartControl.Children and all their parents are always on top of all ChartObjects. Doesn't work in this case.
        Any help will be much appreciated. Thank you.​

        Comment


          Hello rare312,

          This would not be possible. The chart rendering area is a SharpDX RenderTarget and is not WPF. The UserControlCollection is a WPF area that is just layered on top of the chart renderer.

          You can render things in OnRender() under the chart bars or other chart objects.

          Chelsea B.NinjaTrader Customer Service

          Comment


            Originally posted by NinjaTrader_ChelseaB View Post
            Hello rare312,

            This would not be possible. The chart rendering area is a SharpDX RenderTarget and is not WPF. The UserControlCollection is a WPF area that is just layered on top of the chart renderer.

            You can render things in OnRender() under the chart bars or other chart objects.

            https://ninjatrader.com/support/help...ndertarget.htm
            Hey Chelsea.
            Thank you for response.
            Yes. I know it. That's why I was asking about some other collection or Control. Not UserControlCollection.
            So I checked every child, starting from Chart and down to ChartControl.
            I was able to add my control to every of it. But it was on top of ChartObjects every time.​

            Comment


              Anyone know how to add more buttons to the toptoolbar (NOT the titlebar)?
              thanks in anticipation.

              Comment


                Hello Mindset,

                Are you referring to adding objects to the toolbarTopHorizontalStackPanel in the example?

                Create the button object and use toolbarTopHorizontalStackPanel.Add(UIElement) to add the button.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  Hi ChelseaB
                  thanks for the prompt reply.
                  I had done that and realised that it is placing my stack2panel over my stack1 panel.
                  I can get the buttons sort of aligned by changing the margins but it's finicky.
                  Is there anyway to get the code to automate the size of the button according to the content?

                  Comment


                    Originally posted by kkc2015 View Post
                    Hi Dougtre,
                    Try these files.
                    Can't tell you how much this simple file helped me. Thank you very much indeed.

                    Comment


                      Dear ChelseaB

                      Is it possible to attach ATM Strategy to the button in ChartTrader? So that when I press for example button "4", it will select ATM Strategy named "4 contracts". Which means the next trade I take it will use 4 contracts and place TP and SL according to that ATM Strategy?

                      I'm using your piece of code to help me being aware of how many contracts I'm playing with but it lacks automatization. It would be so cool if actualy clicking a button would also select ATM Strategy. Just select, no trigger.

                      Click image for larger version  Name:	image.png Views:	0 Size:	13.4 KB ID:	1326225​​
                      Last edited by Pabulon; 11-30-2024, 03:51 AM.

                      Comment


                        Hello Pabulon,

                        You can try changing the AtmStrategySelector.SelectedValue.

                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          Wonderful, thank You so much.
                          Btw. This should be built in in the core NinjaTrader code in my opinion. Picking ATM strategy with buttons together with water mark on the chart.

                          Comment


                            Chelsea, is there a way to add fields to the Chart Trader to manipulate Strategy integer variables on the fly? I have seen the "shell" example where you open a window to transfer values via an Add-on but I would like to have it integrated together with my Buttons and Check Boxes.

                            Comment


                              Hello Ducman_nl,

                              Yes, this is possible.

                              Using the SampleWPFModifications as an example, add your own UIElement Controls to the chart trader grid instead of buttons.

                              For any text input you will need to suppress the instrument overlay selector with unsupported code.
                              Chelsea B.NinjaTrader Customer Service

                              Comment


                                Okay, and then you update the Strategy variable using a to be created VariableX_ValueChanged event?

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                571 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                331 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                101 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                549 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                549 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X