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 Mizzouman1, Today, 07:35 AM
        4 responses
        18 views
        0 likes
        Last Post Mizzouman1  
        Started by philmg, Today, 01:17 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by cre8able, Today, 01:01 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by manitshah915, Today, 12:59 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by ursavent, Today, 12:54 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X