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.

    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.

        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

            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?

                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

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by love2code2trade, Yesterday, 01:45 PM
                    4 responses
                    28 views
                    0 likes
                    Last Post love2code2trade  
                    Started by funk10101, Today, 09:43 PM
                    0 responses
                    7 views
                    0 likes
                    Last Post funk10101  
                    Started by pkefal, 04-11-2024, 07:39 AM
                    11 responses
                    37 views
                    0 likes
                    Last Post jeronymite  
                    Started by bill2023, Yesterday, 08:51 AM
                    8 responses
                    44 views
                    0 likes
                    Last Post bill2023  
                    Started by yertle, Today, 08:38 AM
                    6 responses
                    26 views
                    0 likes
                    Last Post ryjoga
                    by ryjoga
                     
                    Working...
                    X