Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to apply the same strategy to multiple instruments?

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

    How to apply the same strategy to multiple instruments?

    Currently I use the following two methods to apply my Strategy to multiple instruments:
    1) From NT menu, open a chart for stock ABC, then apply Strategy against this chart; repeat this steps to different instruments.
    2) From NT menu, select Strategies -> New Strategy.. -> Enable. repeat this steps to different instruments.

    Both above methods are from GUI interface, is there a way to apply my strategy to multiple instruments through reading a list of instruments? Thanks.

    #2
    Hello localappleseed, thanks for your post.

    Each strategy must be enabled on a single instrument individually. The only way of automatically adding a series is to use AddDataSeries within the script and have one script trade multiple instruments. We have a guide on multi instrument scripts here:



    Please let me know if I can assist any further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks, Chris.
      So it appears to me that the added new instruments must be hardcoded like:
      AddDataSeries("MSFT", BarsPeriodType.Minute, 5);

      Is there a better way to input the instruments instead of hard-coded?

      Comment


        #4
        Hello localappleseed, thanks for your reply.

        See the "Correlation" indicator as an example of dynamically loading a series. The case where this can and will go wrong is during a backtest in the strategy analyzer.

        Please let me know if I can assist any further.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          So if I need to apply the Strategy to 10 instruments, I would have to use AddDataSeries() 10 times, correct?
          AddDataSeries("MSFT", BarsPeriodType.Minute, 5);
          AddDataSeries("DELL", BarsPeriodType.Minute, 5);
          ...
          ...
          AddDataSeries("NT", BarsPeriodType.Minute, 5);

          I am still thinking if it is possible to read a list of instruments from a file or something like that.

          Comment


            #6
            Hello localappleseed, thanks for your reply.

            You can use a list to load the instruments if you would like, it needs to be tested of course. I do recall doing something similar in the past, so loading in a list of strings during State.Configure should work fine. Doing this will be outside of the scope of support we can provide, but we do have an example here:


            Best regards.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Your help is very much appreciated!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by zstheorist, Today, 07:52 PM
              0 responses
              3 views
              0 likes
              Last Post zstheorist  
              Started by pmachiraju, 11-01-2023, 04:46 AM
              8 responses
              149 views
              0 likes
              Last Post rehmans
              by rehmans
               
              Started by mattbsea, Today, 05:44 PM
              0 responses
              5 views
              0 likes
              Last Post mattbsea  
              Started by RideMe, 04-07-2024, 04:54 PM
              6 responses
              33 views
              0 likes
              Last Post RideMe
              by RideMe
               
              Started by tkaboris, Today, 05:13 PM
              0 responses
              5 views
              0 likes
              Last Post tkaboris  
              Working...
              X