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

Setting session templates for multiple symbols programmatically

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

    Setting session templates for multiple symbols programmatically

    Hello,

    Is it possible to define/assign session templates per instrument via the code?

    Actually, I would like to ignore pre/after market bars for all symbols in my strategy. How can I do that? Is session templates something I should use or there are better ways?

    #2
    While there isn't a supported way to define session template via code you do have two supported options available to you.

    Option 1: Implement a time filter: http://www.ninjatrader.com/support/h...tml?totime.htm
    You can also use this to monitor the session info: http://www.ninjatrader.com/support/h...ml?session.htm

    Option 2: Run the strategy from a chart that has the other series manually added. Doing this will force the individual templates to be used. This is further explained here in the "True Event Driven OnBarUpdate() Method" section: http://www.ninjatrader.com/support/h...nstruments.htm

    Let me know if I can further assist.
    LanceNinjaTrader Customer Service

    Comment


      #3
      Originally posted by alex.nt View Post
      Hello,

      Is it possible to define/assign session templates per instrument via the code?

      Actually, I would like to ignore pre/after market bars for all symbols in my strategy. How can I do that? Is session templates something I should use or there are better ways?
      There is another option that you have. You can select your preferred session template for each instrument under instrument settings. Then run your strategy with instrument settings.

      However, changing instrument settings will also affect all other charts, if you select the session template <instrument settings> when adding a DataSeries.

      Comment


        #4
        Is there a way to change Session Template for a bunch of instruments without having to edit through Instrument Manager one by one?

        Reimporting the symbols with a different Session Template doesn't seem to overwrite the old one.

        -Nick

        Comment


          #5
          There isn't a supported way to do this but it is possible.

          With NinjaTrader closed you can go to Program Files (x86)\NinjaTrader 7\db and edit the instruments.txt file.

          Please note this is unsupported and I will not be able to provide any further assistance with issues that may arise in this process.

          Let me know if I can further assist.
          LanceNinjaTrader Customer Service

          Comment


            #6
            Also wanted to add. The text file is only parsed when you reset the DataBase file's instruments

            Tools -> options -> Data -> Reset instruments
            LanceNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Lance View Post
              There isn't a supported way to do this but it is possible.

              With NinjaTrader closed you can go to Program Files (x86)\NinjaTrader 7\db and edit the instruments.txt file.

              Please note this is unsupported and I will not be able to provide any further assistance with issues that may arise in this process.

              Let me know if I can further assist.
              I know this is an old thread, but it seems instruments.txt only contains symbols that come pre-loaded with NT.

              Is there a text file for symbols that were user-added?

              Thanks.

              -Nick

              Comment


                #8
                Hello nicbizz,

                Thanks for your post.

                No, any added instrument are internal (in the database file).
                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by nicbizz View Post
                  I know this is an old thread, but it seems instruments.txt only contains symbols that come pre-loaded with NT.

                  Is there a text file for symbols that were user-added?

                  Thanks.

                  -Nick

                  You can create a text file for added instruments and then import the text file. For example I have once created a text file for all Nikkei stocks and then imported it.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by gentlebenthebear, Today, 01:30 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post gentlebenthebear  
                  Started by samish18, Yesterday, 08:31 AM
                  2 responses
                  9 views
                  0 likes
                  Last Post elirion
                  by elirion
                   
                  Started by Mestor, 03-10-2023, 01:50 AM
                  16 responses
                  389 views
                  0 likes
                  Last Post z.franck  
                  Started by rtwave, 04-12-2024, 09:30 AM
                  4 responses
                  31 views
                  0 likes
                  Last Post rtwave
                  by rtwave
                   
                  Started by yertle, Yesterday, 08:38 AM
                  7 responses
                  29 views
                  0 likes
                  Last Post yertle
                  by yertle
                   
                  Working...
                  X