Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsArray missing data

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

    BarsArray missing data

    Today I noticed one of my custom indicators seemed 'off'. After investigating, I discovered that my BarsArray for daily ES data is missing two days.

    I siimply add a data series, like so

    AddDataSeries(BarsPeriodType.Day,1);

    After the chart paints, I print out the last 11 bars.

    for (int i = 10; i >= 0; i--)
    {
    Print(Times[1][i].ToShortDateString());
    }

    I get this...




    Where is the Tuesday and Wednesday data?

    I have seen this indicator look incorrect before, but didn't track down the actual problem until today. I'm not doing anything with the data series other than adding it, and reading it's contents.

    Am I missing a refresh step, or something? I should add that the data for 6/27/2019 is correct and is updating in real time.

    Please advise. Thanks!
    Attached Files

    #2
    Hello shorttrader,

    Thanks for your post.

    Could you provide us answers to the following questions so we can assist?

    Who is your data provider?

    If you load a chart and right click > Reload Historical Data do you see these bars on your chart?

    After performing the step above, do you see prints for these days after reloading your script with F5?

    I look forward to your reply.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks for your prompt response. Answers to your questions...

      I'm using Continuum real time data feed.

      I've reloaded historical data several times. I've removed my indicator from my chart and re-added. Same result - missing two days of data in the daily array. What's odd is the primary bars object is displaying correctly on my chart (500 tick). Tuesday and Wednesday data is there.

      Contract Symbol - ES 09-19.

      I will continue to track this issue tomorrow. Will be interesting to see if the problem is isolated to these two days, if the data gap changes, moves forward, or disappears.

      Comment


        #4
        Thanks for your reply shorttrader.

        I have set up a test similar to yours where I test opening a Daily chart with CQG data (what we would see with Continuum) and I Reload All Historical data to ensure that I have these daily bars on my platform. After I have verified I do have these daily bars on my platform, I reloaded the script on the 500 Tick chart and I got all of the prints for these days.

        Demo - https://drive.google.com/file/d/1Oj4...w?usp=drivesdk

        Code:
        namespace NinjaTrader.NinjaScript.Indicators
        {
            public class DataTestIndi : Indicator
            {
                protected override void OnStateChange()
                {
                    if (State == State.SetDefaults)
                    {
                        Description                                    = @"Enter the description for your new custom Indicator here.";
                        Name                                        = "DataTestIndi";
                        Calculate                                    = Calculate.OnBarClose;
                        IsOverlay                                    = true;
                    }
                    else if (State == State.Configure)
                    {
                        AddDataSeries(Data.BarsPeriodType.Day, 1);
                    }
                }
        
                protected override void OnBarUpdate()
                {
                    if (BarsInProgress == 1)
                        Print(Time[0].ToShortDateString());
                }
            }
        }
        Could you let me know if you are seeing any additional issues performing the same test I have?

        I look forward to being of any additional help.
        JimNinjaTrader Customer Service

        Comment


          #5
          Very bizarre - I rebooted my machine over the weekend after applying Windows Updates, and now today all the data appears correctly in my daily BarsArray. No code changes made. I will be monitoring closely over the next several days to ensure that no new data gaps appear. I will reach out again if I continue to see the anomaly.

          Thanks for the help.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ghoul, Today, 06:02 PM
          3 responses
          14 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          44 views
          0 likes
          Last Post jeronymite  
          Started by Barry Milan, Yesterday, 10:35 PM
          7 responses
          20 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by AttiM, 02-14-2024, 05:20 PM
          10 responses
          180 views
          0 likes
          Last Post jeronymite  
          Started by DanielSanMartin, Yesterday, 02:37 PM
          2 responses
          13 views
          0 likes
          Last Post DanielSanMartin  
          Working...
          X