Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars.GetBar Index

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

    Bars.GetBar Index

    Hello,

    from the NinjaTrader SampleGetHighLowByTimeRange I made me an indicator with different calculations and it works basically ok.

    I run the indicator on a 30 min chart. When I add Dataseries 15 min and I set eveything in the bracket if(BarsInProgress==1) then the startbarsago is not correct any more. I try to resolve this now for hours but I cant find a solution. After modifying and testing several times I have no idea what might cause this behavior.

    In parameters I have start time 9:30 and it works ok in 30 min chart. But when I add the dataseries 15 min and put it in BIP=1 then the starttime changes to 2:30 (I do no change in parameters!) And of course I change in the code all Low to Lows[1]/High....


    ???

    Thank you!
    Tony
    Last edited by tonynt; 12-03-2020, 02:29 AM. Reason: add info

    #2
    Hello Tony,

    Below is a link to the help guide for the .SampleGetHighLowByTimeRange.


    When adding multiple series, specify the bar series you would like to get the bar by time from.

    BarsArray[0].GetBar().

    Below is a link to the help guide on BarsArray.


    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      thank you for your reply.

      I attach a sample (reduced to the very minimum!) where you can see that it starts plotting from 2:30, even when parameters with start time 9:30.

      Thank you!
      Tony
      Attached Files

      Comment


        #4
        Hello Tony,

        There are no prints in this.

        How do you know that startDateTime has changed?

        Below is a link to a forum post that demonstrates using prints to understand behavior.


        Print Times[0][0] and Times[1][1] and then print startDateTime.

        Provide the output saved to a text file if you are confirming that the startDateTime variable value is changing.

        As a heads up, it looks like you are getting the time from BarsArray[1]. That is not the chart bars. Meaning you are getting a bar from one series, and then drawing an object on a different series (the primary series, BarsArray[0]). Drawing objects are only drawn on the primary series.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        577 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X