Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Bars.IsLastBarOfSession inconsistent on secondary data series

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

    Bars.IsLastBarOfSession inconsistent on secondary data series

    Hello NT8 ninjascript support,

    I've attached an indicator which demonstrates an issue I've been experiencing using IsLastBarOfSession on a secondary data series that has a different session template applied than the primary dataseries.

    The script adds 2 data series for CL 01-17, one with the RTH session template applied, the other with ETH. I then apply this indicator on a CL 01-17 chart with the same period and an ETH template, so Bars series 0 and Bars series 2 are the same session, where Bars series 1 is an RTH session. Periods of all series are the same (30 minute).

    The script goes through each Bars series update and if IsLastBarOfSession is true, it prints out the series number, bar number, date and time.

    The problem I am experiencing is inconsistent results on the last bar of the RTH series - sometimes not returning "true". It appears this usually occurs primarily on the last bar from the prior day to Today. For example, here is the tail end of the output of the indicator from this morning on a 30 minute CL Nymex Metals - Energy ETH chart loading 15 days.(pacific timezone):

    Bars 0 - Last Bar Of Session: 350 12/2/2016 12:00 AM 140000
    Bars 2 - Last Bar Of Session: 350 12/2/2016 12:00 AM 140000
    Bars 1 - Last Bar Of Session: 91 12/5/2016 12:00 AM 113000
    Bars 0 - Last Bar Of Session: 396 12/5/2016 12:00 AM 140000
    Bars 2 - Last Bar Of Session: 396 12/5/2016 12:00 AM 140000
    Bars 1 - Last Bar Of Session: 102 12/6/2016 12:00 AM 113000
    Bars 0 - Last Bar Of Session: 442 12/6/2016 12:00 AM 140000
    Bars 2 - Last Bar Of Session: 442 12/6/2016 12:00 AM 140000
    Bars 0 - Last Bar Of Session: 488 12/7/2016 12:00 AM 140000
    Bars 2 - Last Bar Of Session: 488 12/7/2016 12:00 AM 140000

    Note that Bars series 1 does not fire a "last bar" for 12/7 (yesterday).


    Please let me know if I've missed something, if this is expected, or if you might suggest a better way to determine the end of a secondary bar series session.

    Thank you,
    greagrea
    Attached Files

    #2
    Hello greagrea, and thank you for your report.

    The indicator attached to this reply delivers the following results. There were some reported HDS outages with the CL instrument recently. I would like to ask if you could attempt your test again, either with your own indicator or the indicator I have attached (which omits printing data series 0, and contains a single print of the time rather than printing the date and time for the previous local midnight twice and the current time once), and let us know if you continue to see the same results.

    Bars 1 - Last Bar Of Session: 45 05 Dec 2016 15:00:00.0000, state Historical
    Bars 2 - Last Bar Of Session: 45 05 Dec 2016 15:00:00.0000, state Historical
    Bars 1 - Last Bar Of Session: 91 06 Dec 2016 15:00:00.0000, state Historical
    Bars 2 - Last Bar Of Session: 91 06 Dec 2016 15:00:00.0000, state Historical
    Bars 1 - Last Bar Of Session: 137 07 Dec 2016 15:00:00.0000, state Historical
    Bars 2 - Last Bar Of Session: 137 07 Dec 2016 15:00:00.0000, state Historical
    Attached Files
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Hi Jessica,

      Thank you very much for taking the time to investigate this, and for the additional test script. I like yours much better. Unfortunately, it still has the same behavior on my end this morning, so unless you are having the same issues with CL historical data server, there must be something else going on here.

      Bars 1 - Last Bar Of Session: 69 02 Dec 2016 11:30:00.0000, state Historical
      Bars 2 - Last Bar Of Session: 304 02 Dec 2016 14:00:00.0000, state Historical
      Bars 1 - Last Bar Of Session: 80 05 Dec 2016 11:30:00.0000, state Historical
      Bars 2 - Last Bar Of Session: 350 05 Dec 2016 14:00:00.0000, state Historical
      Bars 1 - Last Bar Of Session: 91 06 Dec 2016 11:30:00.0000, state Historical
      Bars 2 - Last Bar Of Session: 396 06 Dec 2016 14:00:00.0000, state Historical
      Bars 1 - Last Bar Of Session: 102 07 Dec 2016 11:30:00.0000, state Historical
      Bars 2 - Last Bar Of Session: 442 07 Dec 2016 14:00:00.0000, state Historical
      Bars 2 - Last Bar Of Session: 488 08 Dec 2016 14:00:00.0000, state Historical
      I noticed a couple things you may want to look into:

      1. In your output, each day's bar series has the same bar index value. We are adding bar series for two different session templates - ETH and RTH. Shouldn't they have different session end times, and bar series 1 have significantly less bars in it? That is what my output shows.
      2. I am checking this script before the RTH session opens for today. I will check it again after the open and confirm if it has the same result, but just worth noticing as we compare results.
      3. I wanted to see if another bar period type behaved differently, so I tried altering the two dataseries to BarsPeriodType = BarsPeriodType.Volume, Value = 5000
      Unfortunately, this has the same effect:

      Bars 1 - Last Bar Of Session: 44 05 Dec 2016 11:29:59.9720, state Historical
      Bars 2 - Last Bar Of Session: 90 05 Dec 2016 13:59:59.4330, state Historical
      Bars 1 - Last Bar Of Session: 97 06 Dec 2016 11:29:59.6250, state Historical
      Bars 2 - Last Bar Of Session: 185 06 Dec 2016 13:59:58.2260, state Historical
      Bars 1 - Last Bar Of Session: 164 07 Dec 2016 11:29:59.9490, state Historical
      Bars 2 - Last Bar Of Session: 292 07 Dec 2016 13:59:58.1870, state Historical
      Bars 2 - Last Bar Of Session: 387 08 Dec 2016 13:59:59.5500, state Historical
      Please let me know your thoughts.

      Thank you,
      greagrea

      EDIT:

      Now that today's RTH session has opened, I'm getting the correct output from yesterday's RTH close.

      Bars 1 - Last Bar Of Session: 10 05 Dec 2016 11:30:00.0000, state Historical
      Bars 2 - Last Bar Of Session: 45 05 Dec 2016 14:00:00.0000, state Historical
      Bars 1 - Last Bar Of Session: 21 06 Dec 2016 11:30:00.0000, state Historical
      Bars 2 - Last Bar Of Session: 91 06 Dec 2016 14:00:00.0000, state Historical
      Bars 1 - Last Bar Of Session: 32 07 Dec 2016 11:30:00.0000, state Historical
      Bars 2 - Last Bar Of Session: 137 07 Dec 2016 14:00:00.0000, state Historical
      Bars 1 - Last Bar Of Session: 43 08 Dec 2016 11:30:00.0000, state Historical
      Bars 2 - Last Bar Of Session: 183 08 Dec 2016 14:00:00.0000, state Historical
      Last edited by greagrea; 12-09-2016, 08:15 AM.

      Comment


        #4
        Thank you for the update greagrea. I will be looking to this at the same time as the related report here, http://www.ninjatrader.com/support/f...ad.php?t=92794 . I will report back should I require any more information or have information of my own to report.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Hi Jessica,

          Following up on this. Will a fix be scheduled, or is this behavior expected to remain as is?

          Thank you,
          greagrea

          Comment


            #6
            Hello greagrea, and thank you for your report.


            This behavior was confirmed on our end. We will be investigating this further. Please keep an eye on the NinjaTrader 8 Release Notes page for updates and bugfixes.





            Tracking ID: NTEIGHT-10937
            Jessica P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by algospoke, Yesterday, 06:40 PM
            2 responses
            19 views
            0 likes
            Last Post algospoke  
            Started by ghoul, Today, 06:02 PM
            3 responses
            14 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            45 views
            0 likes
            Last Post jeronymite  
            Started by Barry Milan, Yesterday, 10:35 PM
            7 responses
            21 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by AttiM, 02-14-2024, 05:20 PM
            10 responses
            181 views
            0 likes
            Last Post jeronymite  
            Working...
            X