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

Extract Instrument Name from NinjaTrader.sdf

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

    Extract Instrument Name from NinjaTrader.sdf

    Hi

    I am in the process of extracting my trades from the 'Executions' table within ninjatrader.sdf.

    The 'Instrument' column is of type int64. Are you able to divulge how, for example, MES 06-21 is derived from 62124056207858266?

    Many thanks in advance.

    #2
    Hello FatCanary,

    Thank you for your post.

    Accessing the database is unsupported and would not be able to provide that information.

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hi

      I was afraid you would say that, but no problem.
      Thank you.

      Comment


        #4
        [SOLVED]

        At first I thought the instrument name was somehow encoded as a number. Turns out it's much simpler than that.

        All the information is in the database. It was just a matter of extracting the Master Instrument id from the appropriate table.

        Comment


          #5
          Originally posted by FatCanary View Post
          [SOLVED]

          At first I thought the instrument name was somehow encoded as a number. Turns out it's much simpler than that.

          All the information is in the database. It was just a matter of extracting the Master Instrument id from the appropriate table.
          Thank you for sharing, FatCanary!
          And how are you defining exact contract for futures instruments?
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment


            #6
            Originally posted by fx.practic View Post
            And how are you defining exact contract for futures instruments?
            That's a good question. It's been a while since I coded this, but I think:
            • I'm looking up the Instrument Id (should be column 6 in the Executions table of database).
            • Then looking up that instrument in Instruments table. The MasterInstrument is then listed in the column after the Id column.
            Searching the instrument id for any contract month will give the MasterInstrument id.

            Hope that helps.
            Last edited by FatCanary; 11-16-2021, 07:55 AM.

            Comment


              #7
              Originally posted by FatCanary View Post

              That's a good question. It's been a while since I coded this, but I think:
              • I'm looking up the Instrument Id (should be column 6 in the Executions table of database).
              • Then looking up that instrument in Instruments table. The MasterInstrument is then listed in the column after the Id column.
              Searching the instrument id for any any contract month will give the MasterInstrument id.

              Hope that helps.
              Thanks a lot, FatCanary.
              This is very helpful.
              I am doing it in a same way, but this is my very first experience with databases, and am having a permanent feeling that I am doing everything wrong.
              Your answer lowered my level of stress significantly.
              fx.practic
              NinjaTrader Ecosystem Vendor - fx.practic

              Comment


                #8
                No problem. Really glad you are less stressed

                Let me know if I can help further, just bear in mind I am no expert.

                It took me a fair while to figure out extracting info from the database. I found LINQPad really helpful for determining the database structure and running test queries.
                Last edited by FatCanary; 11-16-2021, 08:24 AM.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by r68cervera, Today, 05:29 AM
                0 responses
                2 views
                0 likes
                Last Post r68cervera  
                Started by geddyisodin, Today, 05:20 AM
                0 responses
                3 views
                0 likes
                Last Post geddyisodin  
                Started by JonesJoker, 04-22-2024, 12:23 PM
                6 responses
                35 views
                0 likes
                Last Post JonesJoker  
                Started by GussJ, 03-04-2020, 03:11 PM
                12 responses
                3,239 views
                0 likes
                Last Post Leafcutter  
                Started by AveryFlynn, Today, 04:57 AM
                0 responses
                6 views
                0 likes
                Last Post AveryFlynn  
                Working...
                X