Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

First Available Data

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

    First Available Data

    Hi,

    In a strategy or an indicator, is it possible to find what the earliest data available for that instrument and bars period?

    There is a firstTime property in BarsSeries although I can only access it when debuggin, the FromDate (which is public) is only the start date that has been requested, even if NT only has data available starting at a later date (as shown in firstTime).

    Screenshot attached from debugging.

    Thanks
    Attached Files
    Last edited by tmfdouglas; 07-18-2018, 03:23 PM.

    #2
    Hello tmfdouglas,

    Thank you for the question.

    For the range of dates, you can generally use the From and To properties.

    Print("From: " + From + " To: " + To);

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks, although when testing From it is returning the same date as FromDate, which in this case is the date I've requested the backtest to start from, 01/01/2017.

      The problem though is that I only have data from 06/06/2017, I've confirmed this by looking at the underlying files for the instrument.

      When debugging I can see a firstTime property, which shows the correct date when data is available from (06/06/2017), not when data has been requested from (01/01/2017).

      Is it possible to access this property?

      Screenshot attached which shows the differences, firstTime is middle right of the screenshot, and From is bottom left.
      Attached Files

      Comment


        #4
        Hello tmfdouglas,

        I am unsure of a way to access the internal property as you have displayed. Have you tried using the Time or Times objects to determine the Time of the first bar for the series?

        If you wanted the first bars time regardless of the UI settings, you could use GetValueAt(0) and that would likely be the most accurate way to know the first time on that specific series.

        You could use Time.GetValueAt(0) or Times[index].GetValueAt(0) to get the time of the very first bar by its index no matter where you are in time.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Time.GetValueAt(0) does what I needed.

          Thanks for your help.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by BarzTrading, Today, 07:25 AM
          2 responses
          26 views
          1 like
          Last Post BarzTrading  
          Started by devatechnologies, 04-14-2024, 02:58 PM
          3 responses
          20 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by tkaboris, Today, 08:01 AM
          0 responses
          6 views
          0 likes
          Last Post tkaboris  
          Started by EB Worx, 04-04-2023, 02:34 AM
          7 responses
          163 views
          0 likes
          Last Post VFI26
          by VFI26
           
          Started by Mizzouman1, Today, 07:35 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X