Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Correlating numbers in NinjaTrader.sdf instrument lists to actual instruments

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

    Correlating numbers in NinjaTrader.sdf instrument lists to actual instruments

    I've been working on utilizing the data in the NinjaTrader.sdf file to draw lines on charts to visually see where historical trades were placed. The .sdf file is created by SQL Server Compact. In it are the values from historical trades i.e. time, price, instrument as well as other information. The time format is recorded in DateTime.Ticks format so that is easy. The price is just decimal price. The instrument list is also in the form of numbers so I just need to get the master list that has the instrument list keys. I requested that info from NT in an email. The response I got was:

    'As accessing the NinjaTrader database is unsupported, there would not be any resources we could share to advise on accessing it. Since this is a topic we could not provide help with, I may suggest opening thread on the forums to consult other community members that have created scripts accessing the NinjaTrader database.'
    Jim D

    Has anyone worked with the database and know how to correlate the instrument numbers to instruments?
    Thanks in advance,
    rmckay
    Last edited by ramckay; 07-19-2021, 06:25 AM.

    #2
    Can't say whether this is the answer or even relevant, but MasterInstrument.All contains all MasterInstruments. Perhaps use MasterInstrument.All to see if an Instrument's position in that collection corresponds with anything you're seeing elsewhere? Just a thought.
    Multi-Dimensional Managed Trading
    jeronymite
    NinjaTrader Ecosystem Vendor - Mizpah Software

    Comment


      #3
      Hi jeronymite, Thanks for the suggestion. The MasterInstruments list holds 1601 listings on my installation and is mostly stocks. I'm trying to cross reference futures contracts and the instrument reference number. The closest solution I've found is to get a .csv file from the orders listing in the Trade Performance window. In the .csv orders file is a column of order ids along with instrument name and price. I then do a match with the .sdf orders table and can get the futures contract name using a data base server (MySQL). Less than elegant, to say the least, and I as of yet have not been able to programmatically create the Trade Performance .csv file. Until I solve that problem I'll just manually get the futures contract names from the MySQL match and put them in a file which I can reference. It will only need to be done at the expiration of the futures contract.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      566 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      330 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      547 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      548 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X