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

Instrument List Dialog

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

    Instrument List Dialog

    I'd like to create a dialog that will show all Instrument Lists and allow the user to select a list. I had a look at the Instrument List dialog, and created an instance of the dialog, but I'm not sure how to make the changes to it. Can this be modified to return the selected list, and remove the right hand column that shows the instruments and apply button?
    Last edited by Matts; 01-20-2019, 02:57 AM. Reason: was incorrect

    #2
    Hello Matts,

    Well, there is an InstrumentSelector object, was this what you were looking at?
    https://ninjatrader.com/support/help...ntselector.htm

    But I'm not aware of a documented InstrumentList dialog window in the help guide. If are certain this is documented, may you provide a link?
    (Are you referring to the Instruments window from the Tools menu? Or are you referring to code in an addon?)

    It is possible to return a list of all instrument lists using undocumented code.
    https://ninjatrader.com/support/foru...nstrument-list

    Or find an instrument list by name and loop through its instruments also using undocumented code.
    https://ninjatrader.com/support/foru...getinstruments

    And then you could create your own control for this. Your control could be a ListView that shows the instruments in the selected list.
    Last edited by NinjaTrader_ChelseaB; 01-20-2019, 08:42 PM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea, the dialog I had loaded is from Tools > Instrument Lists, which isn't in the documentation. I now created a control using ListView inside an NTWindow. I was able to return a list of all instrument lists. The only problem is that the list names don't show in the window after it loads. What's the best way to add a ListView to an NTWindow?

      Comment


        #4
        Hello Matts,

        The Tools > Instruments window is not an open source script that you can add to another window. This window (and all of the other windows for NinjaTrader) are part of the core application and the code is protected.

        Any addon you would be creating would use custom created code.
        Below is a link to an example of the shell of an addon.


        NinjaTrader provides a few controls that you can use in your addon. Anything else you would need to custom create using general C# code.


        I am including public links to 3rd party websites that discuss listviews found through a google search.
        Use the WPF ListView control. The inner GridView is used to display data.

        WPF ListView provides functionality to create a List of collection in a GridView. Learn how to use ListView in WPF and C#.



        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.


        Are you adding each instrument to the list view items after the page loads?


        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I've created the ListView with XAML, but can't find a way to set the Binding of the list to the ItemSource, and DataMemberBinding like in the example - https://www.dotnetperls.com/listview-wpf I tried creating the binding in code, as it seems DataContext isn't available, but it didn't work. The grid loads, but the names aren't displayed. How can the binding be created to display the name field? I'm not planning to add the instruments to this list view, but I might do this at a later time.

          Comment


            #6
            Hello Matts,

            I wouldn't be able to assist with binding. This thread will remain open for any community members that would like to assist.

            You could loop through the instruments or collection and add each element to the ListView with <ListView>.Items.Add().

            Below is a public link to the Microsoft documentation.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thanks for your help. I figured it out now. I had some other issues that were preventing the binding from working, and I was able to use ItemsSource, with a ListBox.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by algospoke, Today, 06:40 PM
              0 responses
              9 views
              0 likes
              Last Post algospoke  
              Started by maybeimnotrader, Today, 05:46 PM
              0 responses
              7 views
              0 likes
              Last Post maybeimnotrader  
              Started by quantismo, Today, 05:13 PM
              0 responses
              7 views
              0 likes
              Last Post quantismo  
              Started by AttiM, 02-14-2024, 05:20 PM
              8 responses
              168 views
              0 likes
              Last Post jeronymite  
              Started by cre8able, Today, 04:22 PM
              0 responses
              10 views
              0 likes
              Last Post cre8able  
              Working...
              X