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

GetBars Session param

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

    GetBars Session param

    What is the Session pSession parameter of the GetBars method for? I'm not certain what I need to pass here.

    #2
    Hello reach4thelasers,

    Thanks for your post.

    Regrettably this is unsupported code and I have no references to provide other than this thread: http://ninjatrader.com/support/forum...ad.php?t=61321
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Yes, I've seen the same advice repeated over and over on these forums. Basically anything more complicated than a Simple Moving Average cross-over isn't supported.

      If NinjaTrader is serious about getting highly experienced .NET engineers like myself to use their platform to write serious kick ass trading systems. Then you should at least be providing an API which is documented. I'm not asking for any kind of Hand-holding in the task of async data processing. But if I ask a simple and direct question like "what does this parameter represent" you should be able to answer.

      There are ZERO code specifications in your API - no information whatsoever provided via intellisense or in visual studio object explorer. Which to be honest is pretty appalling.

      Maybe I should can my project and do an MA crossover strategy.

      Comment


        #4
        Hello reach4thelasers,

        I'm glad to hear that you are excited to develop some advanced items in NinjaTrader. NinjaTrader 8 is going to be much more expansive and many more items will be supported, which may be able to fit your needs. NinjaTrader 8 is currently in an open beta and you can download it at the link below.

        I will have our NinjaScript lead follow up with you tomorrow to see what solutions he can offer you in NinjaTrader 8.
        BrandonNinjaTrader Customer Service

        Comment


          #5
          Cheers brandon -really good news.

          Just some very early feedback (more to come, I'm sure).... Would have been good if you guys had used the Obsolete Attribute to mark breaking API changes and give migration support. I've got over 8000 compiler errors and it takes quite a bit of investigative work to resolve without any guiding metadata such as [Obsolete]

          Marks the program elements that are no longer in use. This class cannot be inherited.
          Last edited by reach4thelasers; 09-21-2015, 07:13 PM.

          Comment


            #6
            Hello reach4thelasers,

            Thank you for your response.

            I have forwarded your suggestion to our product management team.

            Comment


              #7
              reach4thelasers,

              The Session class uses ints and DayOfWeek objects to define individual sessions within a Trading Hours template. It is a compact class with the following public properties:

              Code:
                      DayOfWeek BeginDay
                      int BeginTime
                      DayOfWeek EndDay
                      int EndTime
                      DayOfWeek TradingDay
              You can either instantiate a new Session object defined as desired, or use a Session object stored within the TradingHours.Sessions collection, which relates to the Trading Hours template configured on the NS object.

              Do you mind sharing your goal with using GetBars()? There may be a better way to accomplish your goal, such as the new BarsRequest class:

              http://ninjatrader.com/support/helpG...arsrequest.htm

              If you are looking at the <chartControl>.GetBars() method, we decided not to include that method in documentation, because it is used under the hood and does not return anything useful to a NinjaScript developer (or at least, so we assumed). Depending on your goal, we may need to consider adding it back in.

              You make a very valid point about using the [Obsolete] tag to mark deprecated code. The scope of implementing this right off the bat would have been larger than one may expect, due to the fact that NinjaTrader 8 was built from the ground up, without any code coming over from NinjaTrader 7. That being said, we have discussed adding this tag to any deprecated code moving forward with Version 8, and even into future major releases, and as of now we're pretty set on doing so.

              I'd like to point out two resources that you may not have seen, which can be useful when porting over your code. The first is the code-breaking changes table within the release notes in the help guide, which we update with each new release of NinjaTrader 8. Below you can find the release notes for Build 5, and each prior release beneath it in the navigation:

              http://ninjatrader.com/support/helpG...s/?8_0_0_5.htm

              There is also the main Code Breaking Changes table, which is updated with each new release:

              http://ninjatrader.com/support/helpG...ng_changes.htm

              The second is the language reference index, which we just recently added. This is a great place to check to see if something new has been documented alongside a new release, if you are seeing something unexpected in Intelliprompt:

              http://ninjatrader.com/support/helpG..._reference.htm

              Thanks again for your feedback and participation in the beta program.
              Last edited by NinjaTrader_DaveI; 09-22-2015, 07:54 AM.
              Dave I.NinjaTrader Product Management

              Comment


                #8
                Thanks Dave!

                BarsRequest looks like what I need. My Goal is that I want to grab a bunch of higher-timeframe bars and process it using my own pipeline but I don't require it to be updated in real time. By scanning the Higher Timeframe I can find areas of significant institutional price action which are the absolute upper and lower possible limits of price in the context of the intermediate frame. When price hits these regions it will result in a significant trend reversal in the intermediate time-frame. This information - and more specifically how far I am from these areas dictates whether, where and on what timeframe I enter/exit.

                I might need to go back years to find what I need on the HTF so I was using the GetBars method to grab my HTF data and process it asynchronously.

                Using the standard Add method was resulting in a very slow startup require me to possiblly retrieve 50,000-100,000 LTF bars - just to get the data I needed from the Higher timeframe. I really only need about 300-1000 bars for each of the Lower, Intermediate, Higher, but the total number of bars required in the LTF grows exponentially the further back you go on the HTF with the standard Add method.

                I might actually use GetBarsRequest for all three timeframes if, if i'm able to subscribe to grab the data asynchronously and then subscribe to updates on the LTF and ITF as the docs seem to indicate I can. This would allow me to do all three timeframes in separate threads - It would also prevent the chart (and the whole of Ninjatrader) from freezing while three parallel pipelines are processing the historic data. I've got Dual Intel Xeon Haswell E5-2697 V3 processors with 14 cores each - they like multi-threading 56 Hyperthreads.

                First I need to get the damn thing ported over to NT8 I will let you know when I get onto the BarsRequest part.

                Thanks for your support

                Comment


                  #9
                  You bet. If there's anything we can do to help, just let us know and we'll dig a bit deeper. For now, it sounds like you are on the right track.
                  Dave I.NinjaTrader Product Management

                  Comment


                    #10
                    Hi guys, I was asking something similar here:



                    I would appreciate some more info regarding this since I can see this being useful for a LOT of traders.

                    Thank you

                    Comment


                      #11
                      Originally posted by Sim22 View Post
                      Hi guys, I was asking something similar here:



                      I would appreciate some more info regarding this since I can see this being useful for a LOT of traders.

                      Thank you
                      Jesse's response in the linked post should be a solid approach. This technique can work well for passing data that does not necessarily need to originate in a specific NinjaScript Type.
                      Dave I.NinjaTrader Product Management

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by thanajo, 05-04-2021, 02:11 AM
                      3 responses
                      469 views
                      0 likes
                      Last Post tradingnasdaqprueba  
                      Started by Christopher_R, Today, 12:29 AM
                      0 responses
                      10 views
                      0 likes
                      Last Post Christopher_R  
                      Started by sidlercom80, 10-28-2023, 08:49 AM
                      166 responses
                      2,237 views
                      0 likes
                      Last Post sidlercom80  
                      Started by thread, Yesterday, 11:58 PM
                      0 responses
                      4 views
                      0 likes
                      Last Post thread
                      by thread
                       
                      Started by jclose, Yesterday, 09:37 PM
                      0 responses
                      9 views
                      0 likes
                      Last Post jclose
                      by jclose
                       
                      Working...
                      X