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

Accessing the Tick DB

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

    Accessing the Tick DB

    Is there a way in NT8 to access the Tick DB? I am looking for the ability to retrieve 1 Tick Data based on time without having to Add a Secondary Series (1 Tick) to the chart.

    Something like:
    foreach(Tick between StartTime and EndTime)
    SomeArray.Add(Price, Volume);

    I asked Ray this Q during one of his NT8 Status Update Webinars a year or two ago and I thought he said it could be done. However have not been able to find any documentation for this.

    Thanks.

    #2
    Hello TAJTrades,

    I believe you are wanting to do an out of sync data request, is this correct?

    For this use a BarsRequest.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks, I missed this. Not sure if it will work for what I have in mind but will give it a shot.

      Comment


        #4
        ChelseaB,
        Thanks for the reply. It is exactly what I was looking for and the code is already doing exactly what I want it do do. I have an additional questions:

        In the Link you provided there is a line of code
        barsRequest.TradingHours=TradingHours.Get("Default 24 x 7");

        What would the code snippet be to get the Trading Hours that the Chart was built on. In the sample I would like to get "Default 24 X 7" by code instead of hard coding it in. I poked around and have not found the answer.

        Thanks

        Comment


          #5
          Hello TAJTrades,

          There is a TradingHours object that is part of the NinjaScript base.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            I think http://ninjatrader.com/support/helpG...adinghours.htm needs some attention. The Example really does not deal with the Object.

            After trying a few different ways I got this to work
            barsRequest.TradingHours=NinjaTrader.Data.TradingHours.Get(Bars.TRadingHour s.Name);

            Comment


              #7
              Hello TAJTrades,

              I'm not quite sure I understand.

              If you call Print(TradingHours.Name); are you not seeing the template name appear in the output window?
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Chelsea

                In the Help Guide under TradingHours \ Name the sample code is:

                protectedoverridevoidOnBarUpdate()
                {
                DateTimepreviousEndDate=TradingHours.GetPreviousTradingDayEnd(Time[0]);

                Print(string.Format("The current bars date is {0} - the previous trading session ended on {1}",Time[0],previousEndDate));
                //Output: The current bars date is 2/18/2015 12:35:00 PM - the previous trading session ended on 2/17/2015 3:15:00 PM
                }



                I think that sample code might be for something else, like GetPreviousTradingDayEnd. Just pointing it out so it might get fixed on the next release.

                Comment


                  #9
                  Hi TAJTrades,

                  I understand, thanks for pointing this out.

                  I've sent a message to our product management to correct the page.
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by josh18955, 03-25-2023, 11:16 AM
                  6 responses
                  435 views
                  0 likes
                  Last Post Delerium  
                  Started by FAQtrader, Today, 03:35 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post FAQtrader  
                  Started by rocketman7, Today, 09:41 AM
                  5 responses
                  18 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by frslvr, 04-11-2024, 07:26 AM
                  9 responses
                  126 views
                  1 like
                  Last Post caryc123  
                  Started by selu72, Today, 02:01 PM
                  1 response
                  12 views
                  0 likes
                  Last Post NinjaTrader_Zachary  
                  Working...
                  X