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 rhyminkevin, Today, 04:58 PM
      3 responses
      48 views
      0 likes
      Last Post Anfedport  
      Started by iceman2018, Today, 05:07 PM
      0 responses
      5 views
      0 likes
      Last Post iceman2018  
      Started by lightsun47, Today, 03:51 PM
      0 responses
      7 views
      0 likes
      Last Post lightsun47  
      Started by 00nevest, Today, 02:27 PM
      1 response
      14 views
      0 likes
      Last Post 00nevest  
      Started by futtrader, 04-21-2024, 01:50 AM
      4 responses
      50 views
      0 likes
      Last Post futtrader  
      Working...
      X