Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why do 60 minute CurrentBars[ ]=0 but 30 min CurrentBars[ ] = 29

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

    Why do 60 minute CurrentBars[ ]=0 but 30 min CurrentBars[ ] = 29

    Hi, my first post here. Today my scripts won't run. I tracked issue down to "BarsInProgress". I need at least 2 bars in each of the following, 1 min, 5 min, 10 min, 15 min, 30 min, 60 min for my strategy to work so I do test against BarsRequired. This was not an issue until today (ran the scripts just fine yesterday on Market Replay and for the last month).
    I added a Print (CurrentBars[ ]) within the BarsRequired check to see how many bars I was getting.
    Now at this current time I have the following bar count 890, 296, 178, 89, 59, 29, 0 respectively. Which means I am pulling in data from Kinetick (paid) but not getting any 60 min bars. I do not know if Kinetick is supposed to send the 60 min bars, or NinjaTrader will create 60 min bars from the minute data. I assume the later, but if it is the former, then I suppose the Holiday yesterday could be an issue for Kinetick.

    Question is where should I look next since I can't run anything today?

    PS I know the Title isn't proper code, but was

    #2
    Hello,

    Thank you for the question.

    This could be caused if the charts DaysToLoad is too low and there is no data for one of the requested days. Also you are correct, the data would be converted into the bar time you select from a smaller timeframe such as 1 minute.

    This could potentially happen if the minute series for the instrument in question was not loaded or not cached correctly also, you can try opening a chart for that instrument and going to specifically 60 minutes and requesting the amount of data needed. Next try running the script again and see if this was a historical data issue.

    If you load more days on the chart, do you still have the same issue?

    Are you getting an error in the Output window related to BarsInProgress or this was determined by your own testing?

    Please check the above and let me know if any applies, if not we can continue looking to find the cause.

    I look forward to being of further assistance.

    Comment


      #3
      Hi Jesse, Thanks for the quick response. Been testing and if I set BarsRequired to 16 or lower it works, i.e. reads 16. If BarsRequired is 17 or higher then the 60 Min reads 0.

      When I would load the script from the Strategies tab I wouldn't bother changing the BarsRequired # that is set at 20. Today for some reason Kinetick isn't providing more than 16 x 60 min bars at the moment. I've now hard coded the BarsRequired = 5 into my scripts so hopefully it shouldn't happen again.
      thanks again,
      Don

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      646 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      367 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      107 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      569 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      573 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X