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

    #31
    Thanks. I installed and compiled Custom Chart Trader Buttons yesterday and as I switch tabs I get extra buttons which won't go away when the indicator is removed from the chart.

    Comment


      #32
      ...however. I am unable to duplicate the error from yesterday. I'm not sure what I did to cause it but the custom buttons work properly today.

      Comment


        #33
        Hi RandomTask,

        There is something goofy going on this script. I'm looking further into this.

        I appreciate you letting me know and I appreciate your patience.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #34
          Originally posted by NinjaTrader_ChelseaB View Post
          Hi RandomTask,

          There is something goofy going on this script. I'm looking further into this.

          I appreciate you letting me know and I appreciate your patience.
          Hi ChelseaB,

          FWIW, in a similar case, if you duplicate a Tab in a new tab all the indicators will be duplicated in the new tab, including any custom buttons in the main menu. Now, if you change the new tab to a different instrument the buttons will be duplicated and only one of them can be removed by removing the button indicator and the others remain.

          The point is this behavior happens quite often in a duplicated tab and perhaps you can re-create it.

          Comment


            #35
            Hi RandomTask,

            Updated. Forgot to remove the chartWindow.MainTabControl.SelectionChanged event handler.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #36
              Awesome. Thanks.

              Comment


                #37
                inside strategy parameter change

                Hi
                I assume that if I want the button to change some parameter in my strategy, than I would need to actually move the code for the buttons to be inside of my strategy not as an indicator.
                am I right ?

                Comment


                  #38
                  Hello dadarara,

                  This correct, the code will have to be implemented in your strategy in order to have the strategy add buttons that can modify its behavior.

                  If you have any additional questions, please don't hesitate to ask.
                  JimNinjaTrader Customer Service

                  Comment


                    #39
                    Originally posted by NinjaTrader_Jim View Post
                    Hello dadarara,

                    This correct, the code will have to be implemented in your strategy in order to have the strategy add buttons that can modify its behavior.

                    If you have any additional questions, please don't hesitate to ask.
                    Hi Jim,
                    As a follow-up to this, if I used the indicator code as noted in ChartTraderCustomButtonsExample_NT8.zip, can that indicator return a value so my strategy can detect when Button 1 is clicked for example?

                    Comment


                      #40
                      Hello PN720,

                      I would recommend implementing the code in the strategy and then the strategy can handle the buttons directly. You could create your own events for the button presses in the indicator and subscribe to those events in the strategy, however, implementing in the strategy would be an easier solution.

                      Here's an article that discusses raising and subscribing to events - https://docs.microsoft.com/en-us/dot...consume-events

                      Those concepts fall into the general C# category and outside of the context of NinjaScript, but if you have any other NinjaTrader/NinjaScript related questions we'll be happy to help.
                      JimNinjaTrader Customer Service

                      Comment


                        #41
                        Hello,

                        I am afraid that in version 8.0.16.1 something has changed in the way Chart Trader is opened and "ChartCustomSidePanelExample_NT8.zip" has stopped showing correctly the sidebar close to the Chart Trader.

                        Could you modify and update the example of the first post to work in the same way?

                        Thanks!

                        Comment


                          #42
                          Hello rafaelmarcos,

                          Please see the Update Oct 18th, 2018 note added to this post.
                          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


                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #43
                            Could I get the button move example in NT7? Since the forum was redone looks like the indicator & strategy libraries were wiped out.

                            Comment


                              #44
                              Hello saturntd,

                              I'm not familiar with this indicator.

                              The indicator is moving where a button is placed?
                              Chelsea B.NinjaTrader Customer Service

                              Comment


                                #45
                                Originally posted by NinjaTrader_ChelseaB View Post
                                Hello All,

                                I've made some updates to my examples that modify the WPF elements on a chart to be chart tab specific.

                                When the tab is no longer visible the added controls are removed, when the tab is selected, the controls are added back.

                                ChartCustomSidePanelExample demonstrates adding a custom column and child grid (what looks like a panel) to the chart grid with a few custom buttons similar to ChartTrader.

                                ChartCustomToolbarExample demonstrates adding a custom row above the chart and to the left of the chart to add custom buttons (saving space on the existing chart toolbar).

                                ChartTraderModifyExistingButtonsExample modifies the Buy and Sell Market buttons on ChartTrader. Changes the colors and adds an event handler. The original order actions still take place, however, it also triggers an action with the indicator.

                                ChartTraderCustomButtonsExample adds custom buttons below the PnL display in ChartTrader and below the Bid and Ask display in ChartTrader.

                                To play friendly with other indicators that are modifying the chart, each of these indicators adds rows using the existing chart's TabControl or ChartTrader area as a starting point.

                                When terminating the script, the current column and/or row of the object object is found and removed in case another indicator has changed the row number.

                                For a look at adding buttons to the rendered chart area, the 'LONG SHORT Toolbar Buttons - NT8' strategy is a great example of adding buttons to the UserControlCollection.
                                https://ninjatrader.com/support/foru...php?linkid=697
                                (This example is not well named. It doesn't actually add to the toolbar of the chart like my example does. Instead it adds to the actual rendered chart area)


                                (Updated June 25th, 2018 - ChartTraderCustomButtonsExample and ChartTraderModifyExistingButtonsExample were missing the removal of the chartWindow.MainTabControl.SelectionChanged handler TabChangedHandler in State.OnTermination)

                                (Update Nov 13th, 2018 - Due to new functionality added to resize the ChartTrader Control with a gridsplitter in 8.0.16.0, I've chosen to move the side panel in ChartCustomSidePanelExample to the right of ChartTrader. Small note, the gridsplitter and ChartTrader controls are both in column 1 and only the ChartTrader control spans into column 2 as well.)
                                Hi Chelsea

                                Thanks for the example. I am curious as to how to go about implementing a Chart Trader button whose click actually submits an order, rather than just prints out a text string. Say I want to place a buy limit order 2 ticks below the current price. Would I do this inside of a strategy instead of an indicator and use AtmStrategyCreate...?

                                Thanks

                                Comment

                                Latest Posts

                                Collapse

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