Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SessionIterator

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

    SessionIterator

    I'm trying to understand the discrepancies I'm seeing when using a SessionIterator on multiple dataseries with and without Tick Replay enabled.. Notice this pic

    Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


    2 CL 15min charts loading 10 days of data each, eth default template.. Each chart should be identical.. Except, the one on the right has Tick Replay Enabled.. and the one on the left does not...

    Run this sample script on both charts. no replay first.. and you get the output window printout..

    I actually believe the session iterators are working fine, what I think is happening is it just isn't finding and/or passing the bar or time, of the very last bar, for either BarsArray...

    Also.. After the market reopens tonight.. refresh and notice the GetTradingDayBeginLocal doesn't seem to update until after midnight..


    Please Advise..



    Attached Files
    -=Edge=-
    NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

    #2
    Hello Edge,

    Thank you for your post.

    I will investigate and follow up with you here.

    Comment


      #3
      Hello Edge,

      Thank you for your patience.

      When using Times[BasInProgress][0] rather than BarsArray[BarsInProgress].LastBarTime, I see no issue.
      From what I see LastBarTime is not returning the correct "first bar" for the BarsInProgress.

      Please let me know if you continue to see discrepancies in the logic when using Times[BarsInProgress][0].

      Comment


        #4
        Originally posted by NinjaTrader_PatrickH View Post
        From what I see LastBarTime is not returning the correct "first bar" for the BarsInProgress.
        I assume you mean last bar.. but yes, I believe I stated that..

        Originally posted by -=Edge=- View Post
        I actually believe the session iterators are working fine, what I think is happening is it just isn't finding and/or passing the bar or time, of the very last bar, for either BarsArray...
        Are you telling me this is to be expected? or is this something that needs looked at?



        -=Edge=-
        NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

        Comment


          #5
          Originally posted by -=Edge=- View Post
          Also.. After the market reopens tonight.. refresh and notice the GetTradingDayBeginLocal doesn't seem to update until after midnight..
          Also, at 7pm cst tonight.. what time and date should the GetTradingDayBeginLocal be passing back for ES?


          -=Edge=-
          NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

          Comment


            #6
            Hello Edge,

            Apologizes for the delay and misunderstanding.

            I am reviewing this further on my end and I will follow up when I have further details.

            Comment


              #7
              Hello Edge,

              I think your sample indicator cannot work because you did not apply the session iterator as needed. Calling the session iterator is a two step process:

              You first need to point the session iterator to the current session. This can be alternatively done via

              - sessionIterator.CalculateTradingDay()
              - or sessionIterator.GetNextSession()

              Then in a second step you may use sessionIterator.GetTradingDayBeginLocal or sessionIterator.ActualSessionBegin.

              In case that you omit the first step, the session iterator will return nonsense. Here is a little test indicator that shows that the session iterator is working as expected when correctly applied.
              Attached Files

              Comment


                #8
                Originally posted by Harry View Post
                Hello Edge
                Thanks FT.. I'll try that with the GetTradingDayBeginLocal after hours today to see if that makes a difference.. Although I believe my problem here is getting the very last bar (time), that is loaded on any barsarray, on the first bar of that array..

                On a non-tickreplay chart.. On CurrentBars[x] == 0 ... using BarsArray[x].Count will give you the total count of all the bars that will be loaded for that BarsArray, and BarsArray[x].LastBarTime will give you that bars time.. You could even go about using Bars.GetTime(BarsArrary[x].Count - 1)..

                But when using TickReplay.. This same technique does not seem to work.. Actually seems that when using BarsArray[x].Count and TickReplay.. The count will always/only return the total number of bars processed to that point..

                Which could very well be expected.. A clarification on that would be appreciated.. and if that would be the case, and this is expected, how would I go about finding these values??


                -=Edge=-
                NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

                Comment


                  #9
                  Hello Edge,

                  Thank you for your patience.

                  This has been reported to our development team. I will follow up when we have details on this matter.

                  Comment


                    #10
                    Hello Edge,

                    Thank you for your patience.

                    LastBarTime is undocumented so it's behavior was unexpected. When Tick Replay is used the BarsArray[0].LastBarTime would return the current state of the Tick Replay over the physical bar series, this is (of course) different to what we see when using BarsArray[0].LastBarTime without TickReplay.

                    However, if we use BarsArray[0].BarsSeries.LastBarTime then the values are as expected with or without Tick Replay enabled.

                    I have no word on whether these items will be documented at this time.

                    Please let me know if you have any questions.
                    Last edited by NinjaTrader_PatrickH; 02-24-2017, 01:41 PM.

                    Comment


                      #11
                      Originally posted by NinjaTrader_PatrickH View Post
                      However, if we use BarsArray[0].BarSeries.LastBarTime then the values are as expected with or without Tick Replay enabled.
                      Thanks Pat

                      Although when I try to use

                      Code:
                      BarsArray[0].BarsSeries.LastBarTime

                      it won't compile, with an error of NinjaTrader.Data.Bars does not contain definition for "BarsSeries" and ......


                      Please Advise..


                      -=Edge=-
                      NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

                      Comment


                        #12
                        Originally posted by -=Edge=- View Post
                        Thanks Pat

                        Although when I try to use

                        Code:
                        BarsArray[0].BarsSeries.LastBarTime

                        it won't compile, with an error of NinjaTrader.Data.Bars does not contain definition for "BarsSeries" and ......


                        Please Advise..


                        I believe that is BarSeries, not BarsSeries. Try losing the spurious "s".

                        Comment


                          #13
                          Originally posted by koganam View Post
                          I believe that is BarSeries, not BarsSeries. Try losing the spurious "s".
                          Thanks K.. but turns out I had pasted the code directly into the script from Pats post using BarsArray[0].BarSeries.LastBarTime

                          but when I posted my reply.. I accidently used the s in the post by mistake... That wasn't what I had tested..


                          Although turns out.. had I tested what I posted.. All is good.. LOL

                          So this would be the correct approach...

                          Code:
                          DateTime dt = [COLOR=#080808]BarsArray[/COLOR][COLOR=#000000][1[/COLOR][COLOR=#000000]].[/COLOR][COLOR=#080808]BarsSeries[/COLOR][COLOR=#000000].[/COLOR][COLOR=#080808]LastBarTime[/COLOR][COLOR=#000000];[/COLOR]

                          Thank You Pat for your initial assistance..



                          -=Edge=-
                          NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

                          Comment


                            #14
                            Thank you, Edge.

                            I corrected my post.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Christopher_R, Today, 12:29 AM
                            0 responses
                            9 views
                            0 likes
                            Last Post Christopher_R  
                            Started by sidlercom80, 10-28-2023, 08:49 AM
                            166 responses
                            2,235 views
                            0 likes
                            Last Post sidlercom80  
                            Started by thread, Yesterday, 11:58 PM
                            0 responses
                            3 views
                            0 likes
                            Last Post thread
                            by thread
                             
                            Started by jclose, Yesterday, 09:37 PM
                            0 responses
                            8 views
                            0 likes
                            Last Post jclose
                            by jclose
                             
                            Started by WeyldFalcon, 08-07-2020, 06:13 AM
                            10 responses
                            1,415 views
                            0 likes
                            Last Post Traderontheroad  
                            Working...
                            X