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 trilliantrader, 04-18-2024, 08:16 AM
            4 responses
            18 views
            0 likes
            Last Post trilliantrader  
            Started by mgco4you, Today, 09:46 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by wzgy0920, Today, 09:53 PM
            0 responses
            9 views
            0 likes
            Last Post wzgy0920  
            Started by Rapine Heihei, Today, 08:19 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by Rapine Heihei, Today, 08:25 PM
            0 responses
            10 views
            0 likes
            Last Post Rapine Heihei  
            Working...
            X