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 judysamnt7, 03-13-2023, 09:11 AM
            4 responses
            57 views
            0 likes
            Last Post DynamicTest  
            Started by ScottWalsh, Today, 06:52 PM
            4 responses
            36 views
            0 likes
            Last Post ScottWalsh  
            Started by olisav57, Today, 07:39 PM
            0 responses
            7 views
            0 likes
            Last Post olisav57  
            Started by trilliantrader, Today, 03:01 PM
            2 responses
            19 views
            0 likes
            Last Post helpwanted  
            Started by cre8able, Today, 07:24 PM
            0 responses
            9 views
            0 likes
            Last Post cre8able  
            Working...
            X