• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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, 02: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 Simon Investimens, Today, 03:26 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Marco  
          Started by fx.practic, Today, 05:15 AM
          0 responses
          4 views
          0 likes
          Last Post fx.practic  
          Started by guidoisot, Today, 05:03 AM
          0 responses
          2 views
          0 likes
          Last Post guidoisot  
          Started by EnveousColnago, Yesterday, 06:58 AM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_ChrisSch  
          Started by owreivmatot, Today, 01:38 AM
          0 responses
          1 view
          0 likes
          Last Post owreivmatot  
          Working...
          X