Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsRequest

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

    BarsRequest

    My code:

    barsRequest = new NinjaTrader.Data.BarsRequest(
    parent.Instrument,
    from,
    to);
    barsRequest.BarsPeriod = new NinjaTrader.Data.BarsPeriod { BarsPeriodType = BarsPeriodType.Minute, Value = 60 };
    barsRequest.TradingHours = NinjaTrader.Data.TradingHours.Get(parent.TradingHo urs.Name);
    barsRequest.MergePolicy = MergePolicy.MergeBackAdjusted;
    barsRequest.LookupPolicy = LookupPolicies.Provider;
    barsRequest.Request(new Action<NinjaTrader.Data.BarsRequest, ErrorCode, string>((bars, errorCode, errorMessage) =>
    {
    ..........
    }));

    Instrument: 6E 09-19. from: 01.03.2017, to: 01.07.2019
    Why historical data obtained with this code do not contain data from 16.06.2018 to 24.06.2018 and how to fix it?

    #2
    Hello xasser,

    Thank you for the post.

    Are you able to see the mentioned data in the Historical data managed or from a chart?

    From the provided information I would not be certain what may be wrong aside from the possibility of missing data. If the data is present, this could be related to the cache as well.

    I look forward to being of further assistance.

    Comment


      #3
      Here's the chart. There is also no history from 16.06.2018 to 24.06.2018. After selecting the menu item "Reload all historical data", the data appears. And after that, BarsRequest also returns full data. After cleaning the cache the problem will happen again and again BarsRequest will return not all of the data. At the same time, the period without data can be not only in June 2018, but also in other dates. How to make BarsRequest return historical data without spaces?
      Last edited by xasser; 07-02-2019, 02:28 PM.

      Comment


        #4
        Hello xasser,

        What is the reason you are cleaning the cache after reloading data? This generally does not need to be removed unless specifically advised by support to do so. Are you seeing some situation where the cache is required to be emptied?

        From the description it sounds like the historical data just needed reloaded, however you should not need to remove the cache. If you are manually removing the cache and that is causing the problem, the solution would be to not remove the cache.


        I look forward to being of further assistance.

        Comment


          #5
          The problem is not deleting the cache, but that BarsRequest produces historical data with spaces. If I run the above written code on another computer where it does not load the chart on the instrument "6E 09-19" for the period from 01.03.2017, then BarsRequest will be given historical data, where there will be no period with 16.06.2018 for 24.06.2018. And in order for the historical data to be complete, it is necessary to open the chart for the specified period on that computer and select "Reload all historical data". How do I make sure that BarsRequest gives historical data without gaps without opening the chart for the specified large period??? Maybe I have a bug in my code or need to add something?

          Comment


            #6
            Hello xasser,

            Thank you for the addition details.

            I just wanted to confirm, you are seeing if you only use a BarsRequest without having previously loaded a chart, it will not download historical data. Is that correct?

            Is this also the reason you are deleting the cache, to demonstrate the problem; this is not something you normally do?

            What data provider are you using on both machines, is it the same or different?

            Do you have the option checked Tools -> Options -> Market Data -> Get Data From Server

            I look forward to being of further assistance.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            581 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            338 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            554 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            552 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X