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

Number of days loaded on a chart

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

    Number of days loaded on a chart

    Hi,

    Is there a way on NT8 to access "days to load" in the Data Series, programatically?
    I need to know the number of days loaded.

    Thanks

    #2
    Hello vindiou,

    Thank you for your note.

    This would not be supported however you could write a method to subtract the date of the first bar of the series from the last bar of the series.

    For example,

    Code:
    if(CurrentBar<10) return;
    DateTime StartDate = Time[CurrentBar-1];
    DateTime EndDate = Time[0];
    int Days=(int)(EndDate - StartDate).TotalDays;			
    Print(Days.ToString());
    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Do we have something today?
      I need to print the number of days loaded, bottom right of chart

      Comment


        #4
        Hello AaronKoRn,

        To confirm, you have tried the code in post #2 and this is not giving you a calculation of the number of days loaded?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Most of the time is off by 1 day
          and I also wanna change the number of days is I don’t have enough bars

          mainly because the Delta ninjatrader order flow indicator require days to be loaded and not bars

          Comment


            #6
            Hello AaronKoRn,

            Changing the data series from code is not supported.

            What is the date and time of the first bar update and last bar update?
            What has the suggested code in post # 2 calculated as the number of days?

            Please print this information and provide the output saved to a text file with your next post.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Philippe56140, Today, 02:35 PM
            0 responses
            1 view
            0 likes
            Last Post Philippe56140  
            Started by 00nevest, Today, 02:27 PM
            0 responses
            1 view
            0 likes
            Last Post 00nevest  
            Started by Jonafare, 12-06-2012, 03:48 PM
            5 responses
            3,986 views
            0 likes
            Last Post rene69851  
            Started by Fitspressorest, Today, 01:38 PM
            0 responses
            2 views
            0 likes
            Last Post Fitspressorest  
            Started by Jonker, Today, 01:19 PM
            0 responses
            2 views
            0 likes
            Last Post Jonker
            by Jonker
             
            Working...
            X