Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limit the number of Instrument

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

    Limit the number of Instrument

    Hello Support,

    Strategy and indicator can be applied to as many chart as one's computer can handle. Is there a way for a strategy to limit the number of instruments it can trade ?

    Thanks.

    Regards,

    Edward K.

    #2
    Edward Kunafi, you could check which instrument(s) the strategy is run on via queries to the Instrument class in the code - http://www.ninjatrader-support.com/H...mentClass.html

    Comment


      #3
      Hello Bertrand,

      I read the links but still wondering how I can tell the total number of instruments on all the charts that use the strategy. Within the strategy Initialize, if I test the variable and it is non null, that would count one instrument? How do I know that instrument on chart just for indicators or with strategy ? If two other charts with two different instruments already uses the strategy how is it reflected ?
      Do you have sample codes on Instrument?

      Thanks.

      Regards,
      Edward K.

      Comment


        #4
        Edward, this is unfortunately not possible to limit the # of instances a strategy can be applied. I was referring to merely locking it on a # of instrument that you enabled it on to work on.

        Comment


          #5
          Hello Bertrand,

          Ok, let's forget about instrument. How can we tell the number of instances the strategy exists already on charts. NT should have this somewhere.

          Thanks.

          Regards,

          Edward K.

          Comment


            #6
            Edward,

            There is no programmatic access to how many times a strategy is running. Each instance only knows about itself and nothing else. You can count how many there are running manually by looking at the Strategies tab of the Control Center.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            657 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            373 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            574 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            579 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X