Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Status of CurrentBar when in Historical mode

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

    Status of CurrentBar when in Historical mode

    Hi,

    I would like to get a confirmation regarding the following observation. I think it is a difference in NT behavior comparing NT6.5 with NT7.

    Here is the presumption:
    - I open a chart containing 200 bars in total, the chart window itself displays 100 bars, therefore the horizontal bar-slider is active.
    - I apply an indicator to the chart and click OK. NT passes through all bars and finishes at CurrentBar == 199 (we have 200 bars available).

    Now I move the horizontal bar-slider to the left (upper-right corner black arrow occurs), and the last bar visible on the chart is now #99. Now I reload the indicator:

    In NT6.5, CurrentBar == 99, after the data processing is finished.
    In NT7 CurrentBar == 199, after the data processing is finished.

    Is this observation correct and intended?

    Regards
    Ralph

    #2
    Ralph, I could not reproduce here or I don't follow you a 100% - I see the same behavior for both custom indicators in 6.5 or 7 plotting just the CurrentBar value. If I reload the indicator via F5 on the chart, the relative position on the chart is kept at CurrentBar 99 in both versions. If I reload data at this point, both versions would switch to bar 199 if CalculateOnBarClose is false. What did I miss in your explanations?

    Thanks and enjoy your long weekend!

    Comment


      #3
      No Bertrand, you did not miss something. And I could reproduce your observation with the NT swing indicator, indeed still behaving like NT6.5.
      And I found the reason why I have seen this unexpected behavior: I added a secondary data series:

      Add(PeriodType.Minute, 10);

      If you could try that too, you should experience a different behavior now.

      Thanks for your immediate response, much appreciated
      Ralph

      Comment


        #4
        Hi Bertrand,

        could you try to reproduce the discrepancy described in post #1 with an indicator containing a secondary data series in addition. I think this makes the difference in behavior.

        Regards
        Ralph

        Comment


          #5
          Ralph, for sure it would be different then as CurrentBar works in BIP context, when you return ouf if BIP != 0 I get the values still as expected from my test script plotting CurrentBar.

          Comment


            #6
            Something is wrong, even waiting until BIP==0. I have to admit that it is a little more complicated as described initially. Here is how it goes:
            1. I position the chart to the left most bar and the right most bar is not visible on the chart (upper right corner black arrow).
            2. I put the thest indicator on the chart. The CurrentBar printed with BIP==0 is now the right most bar visible on the chart, but not the last bar available. That is correct behavior.
            3. I do something with the chart window to cause NT to refresh the chart, i.e. move the chart one single bar to the right or simply minimize and maximize the chart. Now CurrentBar in the context of BIP==0 jumps to the last bar available although this last bar is not visible on the chart.
            BTW, if I repeat this test procedure without an additional timeframe in the indicator, then it behaves like I would expect it to behave.

            Regards
            Ralph

            Comment


              #7
              Ralph, could you please attach the test script you used, as I'm unfortunately not able to reproduce on my end here, the printed CurrentBars in all BIP contexts look correct to me, even with moving the chart and min / max it. Thanks in advance.

              Comment


                #8
                Here is the test script. Pic1 shows how it should look like. Pic2 shows the reality of the test script.

                Regards
                Ralph
                Attached Files

                Comment


                  #9
                  Thanks Ralph, could reproduce with your test indicator, though looks to be related to DrawTextFixed and it's called way, as if you Print out CurrentBar outside of it returns correct values.

                  Comment


                    #10
                    Originally posted by NinjaTrader_Bertrand View Post
                    ...though looks to be related to DrawTextFixed and it's called way, as if you Print out CurrentBar outside of it returns correct values.
                    No.

                    I added a print statement. If I apply this indicator with a single data series (
                    I put Add(PeriodType.Minute,
                    1) in comment) then it works as expected, the printing stops at bar 28.
                    If I apply this indicator with a secondary data series in addition, then the printing stops at the last bar available, 1010 in this case.
                    It is as in-consistent as it is with the DrawTextFixed.

                    Regards
                    Ralph

                    Comment


                      #11
                      Ralph,

                      We will get back to you at a later point in time. Thank you for your patience.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        Hi Ralph, we checked further into and the outcome you experienced is expected for MultiSeries indicators.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        598 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        343 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
                        556 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        555 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X