Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get all instruments programmatically?

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

    How to get all instruments programmatically?

    Hi NT experts,

    Is there a way to programmatically access all instruments in the NinjaTrader database?

    I know of `InstrumentList.All`, but that makes it only possible to access instruments that are in an instrument list. I look for a way to get a list of all instruments (from the Tools -> Instruments window).

    (I searched the forum and helpguide but came up empty.)

    Thanks for any suggestions!


    #2
    Hello J_o_s,

    Instrument.All

    For example to loop through all instruments:

    foreach (Instrument instrument in Instrument.All)
    Print(instrument.FullName);
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Awesome! Thanks for the reply Chelsea.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by DJ888, Today, 10:57 PM
      0 responses
      2 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by MacDad, 02-25-2024, 11:48 PM
      7 responses
      158 views
      0 likes
      Last Post loganjarosz123  
      Started by Belfortbucks, Today, 09:29 PM
      0 responses
      7 views
      0 likes
      Last Post Belfortbucks  
      Started by zstheorist, Today, 07:52 PM
      0 responses
      7 views
      0 likes
      Last Post zstheorist  
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      151 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Working...
      X