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

    #91
    Hello SystemTrading,

    You are adding two rows to that area?

    Are you properly counting the rows when altering them? That is probably where the issue. I would look closer at the custom logic you have for this.

    What if you add your buttons in one row?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #92
      Yes, the sample code I posted is adding two rows to that area. I'm not sure if I am properly counting them as I am using the code from your sample. Unfortunately, everything I found online references xaml, so it is not useful to me. I have thought about trying to add a single row, but what I am actually trying to accomplish is a bit more involved than the sample code I posted. I thought using your sample to illustrate my issue would be easier than posting 10,000 lines of code that you have never seen before.

      Comment


        #93
        In the ChartTrader ModifyExistingButtonsExample there the descrption of the TIF combobox " ChartTraderControlTIFComboBox". What is the name of the Quanity box please?

        Comment


          #94
          Hello boreland,

          ChartTraderControlQuantitySelector



          http://ninjatrader.com/support/forum...644#post472644
          Last edited by NinjaTrader_ChelseaB; 04-26-2020, 09:00 PM.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #95
            Hi Chelsea,

            I am repurposing your ChartCustomToolBar sample in a strategy. It working quite well for me, however, when I use CloseStrategy to end the strategy, I get a 'Chart rendering failed error' - the one with the 'directx error has occurred while rendering the chart: HRESULT....'. I do not have this problem if I manually disable the strategy - it seems to exit gracefully.

            Thoughts?

            Thanks!

            Comment


              #96
              Hello shadowfax,



              What State is the strategy in when the method is called?

              If you call CloseStrategy() from OnBarUpdate() does the same error occur?

              If you set a bool from the button to call CloseStrategy() on the next update of OnBarUpdate() does the same error occur?

              Are you properly disposing of objects added to the chart in State.Terminated?
              Chelsea B.NinjaTrader Customer Service

              Comment


                #97
                Is there a example of doing a series of custom rows below the NT8 included chart trader objects just as taking the ChartCustomSidePanelExample code and not putting it to the right of all the other items, but instead putting them at the very bottom of the chart trader (not very bottom, but below all the rest of the NT8 chart trader items)

                Comment


                  #98
                  Hello WHICKED,

                  I do not have any examples of this. These examples are just meant to be general ideas of how to manipulate WPF and shows how to find the chartControl.

                  This thread will remain open for any community members that know of an exact example that you are looking for.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #99
                    Hi Chelsea_B or Ninja support,
                    Could you provide an example code snippet of adding a child submenu to a submenu based on the indicator code you have already provided in ChartCustomToolbarExample_NT8

                    something like:
                    menu1
                    menu1_submenu1
                    child menu1_submenu1_child

                    Thanks

                    Comment


                      Hello dtl-saw,

                      This would fall under general C# education and officially modifying WPF elements of a chart is not documented and officially in the realm of our support. The world of C# and WPF is vast and we do not have resources to be C# educators.
                      The examples I have provided I created as I was personally learning how to manipulate WPF on my own using tutorials found through google searches. I encourage you to do the same.

                      At a high level, menus can be nested in other menus. The <Menu>.Items.Add() shown in the example allows an object to be added to the menu. Try adding a menu using this.

                      I do not have a specific example for this ready at this time. Our examples are created as resources allow and I may not be able to create a custom demonstration script at your request. If we do find some free time in the future we can consider creating this custom example at your request.


                      You can also contact a professional NinjaScript Consultant or Educator who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        Hi Chelsea or anyone who can help,

                        This question concerns the ChartTraderCustomButtonsExample indicator. I want to call the indicator somewhere in my Long Strategy and say: Enter Long when I click Button 1. In my Short Strategy I want to call the indicator and say: Enter Short when I click Button 2. Can anyone please write the code to do this? I want the Button to interact with my Script like this. Thank you so much.

                        // Set n
                        if ((Position.MarketPosition == MarketPosition.Flat)
                        && Button 1 of ChartTraderCustomButtonsExample is clicked))
                        {
                        myEntry1 = EnterLong(Convert.ToInt32(DefaultQuantity), @"entry1");
                        }
                        Attached Files
                        Last edited by Master Trader; 06-27-2020, 10:10 AM.

                        Comment


                          Hello Master Trader,

                          Welcome to the NinjaTrader forums!

                          Our staff cannot write code on your behalf, however this thread will remain open for any community members that would like to assist.

                          Below is a link to an example of submitting orders on button click.



                          Unfortunately, in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. This is so that we can maintain a high level of service for all of our clients as well as our partners.

                          That said, I am happy to answer any questions you may have about NinjaScript if you decide to code this yourself.

                          We do have a large ecosystem available to help you with programming logic questions. You can post on our forum and ask the other 40,000+ forum members.



                          You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            I appreciate the work in this. So let me make an observation. NT is a trading platfrom - it exists to chart data and Buy and Sell instruments.
                            Well i have tried for over 2 hours to get the button to EnterLongLimit(1, High[1]);
                            Yes it should work - its about as basic an order as you can get - I will happily post the code if you can tell me where the error is.

                            it doesn't work - i get random orders coming in - or no orders, etc, etc. And of course sometimes it works perfectly - but only ever once.

                            I used to have all this nicely coded in NT7 and now nothing works. It is so immensely frustrating. To the point I might go back to NT7 - which I really shouldn't have to do.
                            I really feel NT should have provided some conversion processes at a reasonable price - the consultants I have contacted want thousands of dollars for 3 indicators!!

                            I have a basic understanding of Ninjascript ( NT even converted my BarTimerFlashFusion effort into NT8) and yet now it's decidely difficult to do anything without a vast knowledge of C# and all it's ramifications.

                            Ok rant over - I feel better now but I would like to have a resolution of this entry order thing.

                            Comment


                              Hello Mindset,

                              Use prints to now when the method is being called, use TraceOrders to know when an order is being ignored or cancelled.

                              Below is a link to a forum post that demonstrates using prints and TraceOrders to understand behavior.


                              Enable TraceOrders, then print the time of the bar and all values used in the conditions that place orders.
                              Save the output to a text file.
                              Include this with your next post.

                              I am happy to assist with analyzing the output.
                              Chelsea B.NinjaTrader Customer Service

                              Comment


                                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.)
                                Would it be possible to remove the toolbar on the left for ChartCustomToolbarExample_NT8.zip? I tried doing it myself for a few hours now but it keeps breaking.
                                Unsuitable
                                NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Perr0Grande, Today, 08:16 PM
                                0 responses
                                2 views
                                0 likes
                                Last Post Perr0Grande  
                                Started by elderan, Today, 08:03 PM
                                0 responses
                                3 views
                                0 likes
                                Last Post elderan
                                by elderan
                                 
                                Started by algospoke, Today, 06:40 PM
                                0 responses
                                10 views
                                0 likes
                                Last Post algospoke  
                                Started by maybeimnotrader, Today, 05:46 PM
                                0 responses
                                9 views
                                0 likes
                                Last Post maybeimnotrader  
                                Started by quantismo, Today, 05:13 PM
                                0 responses
                                7 views
                                0 likes
                                Last Post quantismo  
                                Working...
                                X