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

Understanding NinjaTrader.Cbi.Exchange - getting a persistent reference

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

    Understanding NinjaTrader.Cbi.Exchange - getting a persistent reference

    Hello,

    My addon will have a combo box that will allow the user to select an exchange, and after the exchange is selected, a list of pre-saved ticker symbols available on that exchange will be pulled from MySQL and displayed in the addon window. I want to populate this combo box from the NinjaTrader.Cbi.Exchange type. I see 81 fields there, and am trying to figure out which value from the field structure I should be using.

    For example, Nyse is:
    - field at index [34]
    - MetadataToken = 67111518
    - Name = "Nyse"


    Which one of these should I be saving with my pre-selected tickers? I suppose the Index value may change, the name might change as well, but I am guessing the MetadataToken may correspond to some unique ID of the exchange.

    Am I correct?

    Thanks,

    Libor

    #2
    Hello Libor,

    I would recommend using the MasterInstrument.Exchanges value.


    NinjaTrader.Cbi.Exchange is undocumented, but the Name field is likely all you would to save.

    Saving to an Sql database is outside of the realm of NinjaTrader Support. However, this thread will remain open for any community members that would like to assist.
    Last edited by NinjaTrader_ChelseaB; 05-11-2017, 07:15 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,

      thank you very much for the quick reply. I do not need assistance with SQL, I just wanted to understand what is the pertinent value to keep in my database.

      Regarding the MasterInstrument.Exchanges value - that is what I am using, but the range of values accepted by MasterInstrument.Exchanges is defined in the NinjaTrader.Cbi.Exchange type, and that is what I was trying to understand. From what you are saying it seems as though there is no unique id for the exchanges and I should just use the name. Is that correct? (I was hoping the MetadataToken was it...)

      Thank you again,

      Libor

      Comment


        #4
        Libor,

        I would only recommend using the name and populating the list by name. No indexes or tokens are guaranteed not to change.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by yertle, Yesterday, 08:38 AM
        7 responses
        28 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by bmartz, 03-12-2024, 06:12 AM
        2 responses
        21 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by funk10101, Today, 12:02 AM
        0 responses
        5 views
        0 likes
        Last Post funk10101  
        Started by gravdigaz6, Yesterday, 11:40 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by MarianApalaghiei, Yesterday, 10:49 PM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X