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

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
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        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 llanqui, Yesterday, 10:29 AM
            4 responses
            23 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by TAJTrades, Today, 11:03 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by Dziu-Dziu, 02-04-2018, 07:46 AM
            26 responses
            1,767 views
            0 likes
            Last Post mochibocchi  
            Started by DawnTreader, 05-08-2024, 05:58 PM
            19 responses
            78 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by cshox, Today, 11:11 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X