Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

FirstBarOfSession is OutOfSync for a 2 timeframe MinuteTick chart

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

    FirstBarOfSession is OutOfSync for a 2 timeframe MinuteTick chart

    Hi,

    attached you can find an indicator with a second data series added.

    If the second data series is 1 minute, then the related session times are provided as expected. Here is an example. First DS: 30 minute, Second DS: 1 minute, Session break: 15:30. Both value pairs for the session time show correct values for both, primary and secondary timeframe:
    Code:
    New Session BarsInProgress: 1 Time[0]: 26.05.2010 15:31:00 sessionBegin: 26.05.2010 15:30:00 sessionEnd: 27.05.2010 15:30:00
    New Session BarsInProgress: 0 Time[0]: 26.05.2010 16:00:00 sessionBegin: 26.05.2010 15:30:00 sessionEnd: 27.05.2010 15:30:00
    Here is the second setup: First DS 30 minute, Second DS: 1 tick. FirstBarOfSession is active during the whole first second and the session time pairs shows the values of the previous session:
    Code:
    New Session BarsInProgress: 1 Time[0]: 26.05.2010 15:30:00 sessionBegin: [B]25.05.2010 15:30:00[/B] sessionEnd: [B]26.05.2010 15:30:00[/B]
    New Session BarsInProgress: 1 Time[0]: 26.05.2010 15:30:00 sessionBegin: [B]25.05.2010 15:30:00[/B] sessionEnd: [B]26.05.2010 15:30:00[/B]
    New Session BarsInProgress: 1 Time[0]: 26.05.2010 15:30:00 sessionBegin: [B]25.05.2010 15:30:00[/B] sessionEnd: [B]26.05.2010 15:30:00[/B]
    New Session BarsInProgress: 1 Time[0]: 26.05.2010 15:30:00 sessionBegin: [B]25.05.2010 15:30:00[/B] sessionEnd: [B]26.05.2010 15:30:00[/B]
    New Session BarsInProgress: 1 Time[0]: 26.05.2010 15:30:00 sessionBegin: [B]25.05.2010 15:30:00[/B] sessionEnd: [B]26.05.2010 15:30:00[/B]
    New Session BarsInProgress: 1 Time[0]: 26.05.2010 15:30:00 sessionBegin: [B]25.05.2010 15:30:00[/B] sessionEnd: [B]26.05.2010 15:30:00[/B]
    New Session BarsInProgress: 1 Time[0]: 26.05.2010 15:30:00 sessionBegin: [B]25.05.2010 15:30:00[/B] sessionEnd: [B]26.05.2010 15:30:00[/B]
    New Session BarsInProgress: 1 Time[0]: 26.05.2010 15:30:00 sessionBegin: [B]25.05.2010 15:30:00[/B] sessionEnd: [B]26.05.2010 15:30:00[/B]
    New Session BarsInProgress: 1 Time[0]: 26.05.2010 15:30:01 sessionBegin: 26.05.2010 15:30:00 sessionEnd: 27.05.2010 15:30:00
    New Session BarsInProgress: 0 Time[0]: 26.05.2010 16:00:00 sessionBegin: 26.05.2010 15:30:00 sessionEnd: 27.05.2010 15:30:00
    Regards
    Ralph
    Attached Files

    #2
    Hi Ralph, thanks for the test indicator and report, we're currently looking into a related issue as well.

    Comment


      #3
      Ralph, was unfortunately not able to reproduce your print output here - what provider, symbol, timezone and session template were you using in your tests?

      Comment


        #4
        Hi Bertrand,

        no standard setup. I used ES tick data provided by IB and I defined a special 24h-session template with the session break a the opening of the S&P future RTH (15:30 german time in this particular case).
        My impression concerning the source of the issue is that there have to occur multiple ticks during the second before and the second after the session break. In my example, the first second at the session break carries 8 ticks in total.

        If required, I could send you the tick and minute data for the 2 sessions around that session break.

        Regards
        Ralph

        Comment


          #5
          Thanks for the details Ralph, will look into shortly here.

          Comment


            #6
            Was able to reproduce on your custom session - we'll look into, thanks for reporting this in.

            Comment


              #7
              Problem with Bars.FirstBarOfSession

              I have two identical charts open, both using session times as per instrument manager. The charts only have two indicators

              - an indicator that shows Bars.FirstBarOfSession (green vertical line)
              - an indicator that uses Bars.FirstBarOfSession (range indicator)

              As you can see the two identical charts have identified different bars as first bar of session.

              Chart A (left) identifies the first bar and the last bar (prior to the close! ) as the first bar of session. Chart B (right) only identifies the correct first bar of the session.

              The indicator using FirstBarOfSession plots a false opening range on chart A and a correct opening range on chart B.

              Now what is this? If I cannot even be sure that a NinjaTrader indicator plots in an identical way on two identical charts, the whole software is unusable. I am really annoyed as this definitely undermines my confidence in the product.

              Only difference between Chart A and Chart B: The Chart A was progressively built with real-time data, when I was connected to IB. This is the offensive chart with the false second bar in the end of the session. The correct chart B was also built with real-time data, as I had not downloaded the data for ES before disconnecting. This can be seen from the data edited with the historical data manager. which stops at 19:35, about 2 and half hour before the close.
              Attached Files

              Comment


                #8
                Harry,

                At what point in time was chart B opened? At what point in time were both indicators added? CalculateOnBarClose settings for both?
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Charts opened:

                  Left chart (A), false, was opened at 19:35 -> for historical data update see edited data
                  Disconnected from IB at 22:31 (15:31 Central Time, shortly after night session start)
                  Right chart (B), correct, was opened after the close around 22:40, when NT was still disconnected

                  Indicators were added, when chart was opened.

                  Both indicators, anaOpeningRangeV21 and FirstBarOfSession are in "CalcOnBarClose = true" on both charts. The third indicator, which is colouring the bars is in "CalcOnBarClose = false" mode, because it would not colour any bars otherwise.

                  Comment


                    #10
                    Harry,

                    I had a colleague test your indicator this morning on market open. Please find the attached screenshot. The top chart was created prior to the market so it was a historical chart rolling live on the first tick of the first bar of the session. The bottom chart is a chart opened a few bars after the first bar of the session was already established. You can see both were formed on the exact same bar.

                    We will try again to see if it makes a difference later in the afternoon with the ETH session templates.
                    Attached Files
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Hi Josh,

                      thanks for the answer.

                      I do not know whether this can be reproduced here either. The data was real-time versus real-time, so my suspicion is that the rolling real-time had a different time stamp than the real-time loaded after session close and disconnecting.

                      Willl try to reproduce this evening with my workspace.

                      Comment


                        #12
                        Harry,

                        Unfortunately still not reproducible this afternoon. All tests done on our end were based off of collected real-time data. There was no reloading over the stored real-time data to get different historical data.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          NT 7.0.0.17, data feed Interactive Brokers.

                          Have this regularly, and as I saw on another thread, I am not the only one.

                          What you need to do to reproduce, let a chart run for several hours (2 should be enough) prior to close. FirstBarOfSession will then become true for the settlement bar and the following bar (when completed). This only occurs with realtime data (Interactive Brokers, CET) not with historical data.

                          So if I reload the chart or open a new chart, there is no problem.

                          I further checked the time stamp of the bar in the data box. It is correctly time-stamped 22:15.
                          Attached Files

                          Comment


                            #14
                            Please clarify CalculateOnBarClose setting used for the indicator. Thanks.
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #15
                              Indicator is set to CalculateOnBarClose = true. The chart below only shows the condition true for the settlement bar, because the first bar of the session was not yet complete.

                              After the compIetion of the first bar of the new session I had two consecutive green bars, the settlement bar and the first bar of session, for both the condition Bars.FirstBarOfSession was true.

                              Cannot reproduce now, because I have reloaded the charts since, but could reproduce on Monday.


                              Originally posted by NinjaTrader_Josh View Post
                              Please clarify CalculateOnBarClose setting used for the indicator. Thanks.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              626 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              359 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              105 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              562 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              567 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X