• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Batch/programmatic creation of instrument lists

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

    Batch/programmatic creation of instrument lists

    I want to create and analyze strategies over a large number of instrument lists.

    How can I create instrument lists using command-shell, batch script, or direct-DB access?

    I have 200 lists of tickers, and each list has a unique name. Using the GUI tools like "Importing a List of Stock Symbols" would be too tedious to create each list by hand.

    #2
    Hello dbooksta,

    Thank you for your post.

    There is no supported method of importing a list of instruments through NinjaScript. You can load a list from a .txt file through the Import Stock Symbol List window without the need to type in each instrument name. Please go to File > Utilities > Import Stock Symbol List > Load. The symbols will need to be on the same exchange though.

    Please let me know if I may be of further assistance.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Like I said, that would be too tedious.

      It appears that I can create an instrument list directly in the NinjaTrader database using the following tables:
      nt_instrumentlist
      nt_instrument2instrumentlist
      nt_instrument
      nt_masterinstrument
      Is there any reason not to do direct creation in the DB?

      Comment


        #4
        Hello dbooksta,

        Thank you for your response.

        This would be unsupported and undocumented. Unexpected results can occur from altering the database directly.
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          Fair enough.

          Now suppose that one way or another I get a few hundred instrument lists into NT and I want to backtest a strategy over them. Is there any way run strategy analysis over multiple instrument lists, or can it only be done by hand one at a time?

          Comment


            #6
            Hello dbooksta,

            Thank you for your response.

            You can run a basket test on an instrument list in NinjaTrader through the Strategy Analyzer: http://www.ninjatrader.com/support/h...asket_test.htm
            Patrick H.NinjaTrader Customer Service

            Comment


              #7
              My real objective is to backtest a single strategy against a different set of stocks each day. I can create an instrument list for each day, but I don't want to have to run 200 separate one-day strategy analyses and compile their results by hand. Is there some method by which I might accomplish this "variable basket backtest" in NT?

              Comment


                #8
                Hello dbooksta,

                Thank you for your response.

                So are you detailing that you would potentially have 200 different instrument lists? Or 200 different instruments in one list?
                Patrick H.NinjaTrader Customer Service

                Comment


                  #9
                  200 different instrument lists, each consisting of multiple instruments (to be run on a particular historical date).

                  Comment


                    #10
                    Hello dbooksta,

                    Thank you for your response.

                    There would not be an option to basket test a group of instrument lists. I would recommend adding the lists into one instrument list to perform your basket tests. You could write to an external file through NinjaScript and write the performance of the strategy to the external file, so that compiling a large list of information would be easier. You can find an example of writing to external file at the following link: http://www.ninjatrader.com/support/f...ead.php?t=3475
                    Patrick H.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by usero86, Today, 04:28 AM
                    3 responses
                    15 views
                    0 likes
                    Last Post NinjaTrader_PatrickG  
                    Started by bohenriksen, Today, 04:00 AM
                    0 responses
                    8 views
                    0 likes
                    Last Post bohenriksen  
                    Started by Derjan, Today, 03:09 AM
                    0 responses
                    8 views
                    0 likes
                    Last Post Derjan
                    by Derjan
                     
                    Started by CDXTrader, Today, 12:29 AM
                    0 responses
                    11 views
                    0 likes
                    Last Post CDXTrader  
                    Started by TopGun13, Yesterday, 10:35 PM
                    0 responses
                    7 views
                    0 likes
                    Last Post TopGun13  
                    Working...
                    X