Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Inconsistent "IsFirstBarOfSession"

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

    Inconsistent "IsFirstBarOfSession"

    I have not reported this because I thought it was my issue...(still could be I suppose)....but occasionally I get inconsistent results when checking "IsFirstBarOfSession" and "Is LastBarOfSession".
    In the screen shots I have a regular CME Index Futures chart, using the standard Trading Hours RTH session. On once chart (looking back 120 days) I get both First & Last Bars of sessions right up to the end....but when I change the lookback period to (in this example) 33 days, I do not get the last IsFirstBarofSession and IsLastBarOfSession.

    The code is simple.....

    PHP Code:
    protected override void OnBarUpdate()
            {
                if (
    BarsArray[0].IsFirstBarOfSession)
                    
    Draw.Text(this,"fb"+CurrentBars[0],"IsFirstBarofSess",0,High[0]+(15 TickSize),false,"default");
                
                if (
    BarsArray[0].IsLastBarOfSession)
                    
    Draw.Text(this,"Lb"+CurrentBars[0],"IsLastBarofSess",0,High[0]+(15*TickSize),false,"default");
                
            } 
    I have attached the actual code I used...(aaaa.zip) along with the screen shots.
    ....I did a 'reload' of historical data just before running this example, so I tend to think that the issue is not related to missing data. I also have been able to replicate this using different Trading Hours Templates....(I first noticed it on my 'custom' TH template that only inlcudes the European session (start 2am) and the standard Cash session. At the time I thought my session was set up incorrectly, but I can replicate this on the standard Ninja provided sessions.

    EDIT: almost forgot....the data feed is NinjaBroker
    Attached Files
    Last edited by photog53; 01-21-2016, 11:14 AM.

    #2
    photog53,
    Thank you for writing.

    I will be reviewing your code and this case. When I have additional details I will follow up here on this thread.

    Comment


      #3
      I just noticed a few tidbits that might be helpful....

      The original chart that I used to 'create' my cache for the examples I submitted was a 120 day chart... When I create a second chart with fewer days is when I noticed the issue.

      The Chart DataSeries I was using when this occurred was a Second(450) chart....(in fact most of the times I remember this problem I was using something like a 60 second instead of a 1 minute.

      Comment


        #4
        photog53,
        Thank for waiting.
        I was wondering if you could send me the settings for your Data Series because I am not getting the same results that is depicted in your screenshots. Also I would like to know what session are you having trouble with.

        I want to make sure you are using the NinjaTrader Continuum.

        I'll be waiting for your reply.

        Comment


          #5
          Sorry....those answers are sort of buried in my earlier comments below

          Yes...ninja Continuum
          using a ' 450 Second' dataseries (equivalent to 7 1/2 minutes)...although I get the same problem using a 60 second chart.

          I do not get this problem all the time..... and I can get past it by flushing cache and rebuilding.
          I don't encounter the problem all the time ....but....neither does it quite ever go away for good.

          ....also....resend my earlier comments
          The original chart that I used to 'create' my cache for the examples I submitted was a 120 day chart... When I create a second chart with fewer days is when I noticed the issue.

          Comment


            #6
            Hello photog53,

            Thank you for replying back with some information that I requested.

            Upon testing everything that you have given me and tested a couple of times deleting the cache and reloading the historical data on a 120 day chart and an 33 day chart with different bar timers. I cannot produce the inconsistently between each chart. I did notice that both your screenshots were the same, but when I tested my time stamps were different from yours. I was wondering what session specifically were you using?

            I'll be waiting...

            Comment


              #7
              I appreciate your effort.

              The Session I was using was the standard Ninja "CME US Index Futures RTH'.

              For what it's worth, I don't think there is anything 'magic' about the 120 versus 33 day lookback. I've had it happen on 15 day lookback and a 3 day lookback...you name it....but it does not happen in such a way that I can reproduce it at will.
              Once it starts, I can then run the charts and flip back and forth, and the missing IsFirstBarOfSession will consistently not work on the chart that is a different 'lookback' from the lookback period on the chart the data was initially loaded under.

              The few discerning factors seem to be.....
              1. Original data gets loaded on a chart with a bigger lookback
              2. A subsequent (smaller lookback) chart is used and SOMETIMES the error occurs.
              3. It has only happened when I have using something other than 'minute' data...(in this case Seconds.

              Very strange....
              If I figure out how to replicate it at will, I'll send you another note.
              Last edited by photog53; 01-21-2016, 07:27 PM.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by WeyldFalcon, 08-07-2020, 06:13 AM
              11 responses
              1,421 views
              0 likes
              Last Post jculp
              by jculp
               
              Started by RubenCazorla, Today, 09:07 AM
              0 responses
              1 view
              0 likes
              Last Post RubenCazorla  
              Started by BarzTrading, Today, 07:25 AM
              2 responses
              29 views
              1 like
              Last Post BarzTrading  
              Started by devatechnologies, 04-14-2024, 02:58 PM
              3 responses
              21 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by tkaboris, Today, 08:01 AM
              0 responses
              6 views
              0 likes
              Last Post tkaboris  
              Working...
              X