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 giulyko00, Today, 11:49 AM
              2 responses
              11 views
              0 likes
              Last Post giulyko00  
              Started by Aviram Y, Today, 06:03 AM
              2 responses
              10 views
              0 likes
              Last Post Aviram Y  
              Started by FishTrade, Today, 03:42 PM
              0 responses
              1 view
              0 likes
              Last Post FishTrade  
              Started by Richozzy38, Today, 01:06 PM
              3 responses
              14 views
              0 likes
              Last Post Richozzy38  
              Started by ttrader23, Today, 09:04 AM
              2 responses
              12 views
              0 likes
              Last Post ttrader23  
              Working...
              X