Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddDataSeries barsToLoad not working anymore after update

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

    AddDataSeries barsToLoad not working anymore after update

    Hi, I just updated my instance of NinjaTrader to version 8.0.10.0 and noticed that when I add a dataseries with the parameter barsToLoad set it doesn't take the value into account. Instead it takes the value of the initial data series.Yesterday (before the update) everything was working fine.

    Below you can find a simplified version of my code.

    Code:
            protected override void OnStateChange()
            {
                if (State == State.SetDefaults)
                {
                    this.LookbackPeriod = 20000;
                }
                else if (State == State.Configure)
                {
                    AddDataSeries(Instrument.FullName, BarsPeriod, (this.LookbackPeriod + base.Bars.Count), Instrument.MasterInstrument.TradingHours.Name, null);
                }
            }
    
            protected override void OnBarUpdate()
            {
                if (BarsInProgress == 0) // Initial data series
                {
    
                }
                if (BarsInProgress == 1 && State == State.Historical)
                {
                    // Normally this will be triggered x times (duration of lookbackperiod) before BarsInProgress will be 0 
                }
            }

    #2
    Hello Vanderbeke,

    Thanks for your post.

    It is expected that an instrument added that is the same as the chart will always use the same length of data as the chart. In this case, the BarsToLoad parameter is ignored. This has been the case all along so I am unable to explain your observations that it was working between 8.0.9.0 and 8.0.10.0.

    The barstoload parameter will work on an added instrument that is different than the chart.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi Paul

      My previous version was 8.0.4.0. I don't know if this makes any difference.

      It's strange indeed because I developed the indicator yesterday and it didn't ignored the BarsToLoad parameter. I know for sure because I've used the Visual Studio debugger to confirm.

      Is there any other possibility then to do some calculations on historical data of the same instrument that goes many bars back than the current chart loads?

      Comment


        #4
        Hello Vanderbeke,

        Thanks for your reply.

        I have previously investigated this issue with another client in 8.0.7.0 and working with development here it was clarified then that this (bars to load will be based on chart data set if adding the same instrument) is the expected behavior.

        I am not aware of a means to calculate beyond the days loaded.

        If you have historical calculations that would not change, an alternative may be to write a separate indicator that can access the data needed on another chart and then write the values needed to a data file that then could be read when you run your existing indicator. We have a working examples of reading and writing files here:


        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Hi Paul, thanks again for the feedback.

          Do you know why it is so hard to add another dataseries of the same kind? Especially when others of any length could be added? Is this something that can be included in a new update?

          Comment


            #6
            Hello Vanderbeke,

            Thanks for your reply.

            I will write a feature request to allow the bartoload parameter to override the chart barstoload. A feature request does not mean that the feature will be implemented, it is used to let program management be aware of user requests. The feature requests are routinely reviewed. If the feature request already exists, your vote will be added to it. I will update this thread when I have the feature request tracking ID.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Ok, thanks Paul!

              Comment


                #8
                Hello Vanderbeke,

                Just to follow up.

                The feature request to allow the adddataseries() barstoload parameter to override the charts barstoload when the chart is the same data series is SFT-2823.

                Thanks for your interest in adding this feature.
                Paul H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bortz, 11-06-2023, 08:04 AM
                47 responses
                1,611 views
                0 likes
                Last Post aligator  
                Started by jaybedreamin, Today, 05:56 PM
                0 responses
                9 views
                0 likes
                Last Post jaybedreamin  
                Started by DJ888, 04-16-2024, 06:09 PM
                6 responses
                19 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by Jon17, Today, 04:33 PM
                0 responses
                6 views
                0 likes
                Last Post Jon17
                by Jon17
                 
                Started by Javierw.ok, Today, 04:12 PM
                0 responses
                22 views
                0 likes
                Last Post Javierw.ok  
                Working...
                X