Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetSessionBar() flawed

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

    GetSessionBar() flawed

    NT 7.0.0.20

    The values returned by Bars.GetSessionBar() are often false. I have written many, messages here that the session logic is flawed and needs to be reworked. This is just another example.

    To facilitate the detection of false values returned by Bars.GetSessionBar(), I have coded a small indicator (attached).

    Also you can have a look at the charts below. You can see that GetSessionBar() does not return the correct values for the high, low and close.
    Attached Files
    Last edited by Harry; 08-25-2010, 12:36 PM.

    #2
    GetSessionDate() with the same virus infection.

    Just to add that our friend GetSessionDate() finds a week with two Mondays.
    Attached Files

    Comment


      #3
      PriorDayOHLC also flawed

      The PriorDayOHLC indicator does not work correcly either, because it uses the flawed methods.

      I now remember that I have already reported this bug months ago, but nothing happened so far.
      Attached Files
      Last edited by Harry; 08-23-2010, 06:00 AM. Reason: chart added

      Comment


        #4
        Repeating my suggestion

        The problem occurs specificly with the session template CME ETH Index Futures, because the Monday session is 90 minutes shorter than the other four sessions.

        To avoid the display of false session bars, session dates, you would need to reference the end time of a session instead of the start time. This is in line with the official definition of session and trade dates by the exchanges.

        The session date is always the date associated with the closing time, never the open.

        Session.FirstBarOfSession works correctly, so with proper logic, it would be easy to build a PriorDayOHLC indicator with this one.

        Comment


          #5
          Hello,

          Thank you for your patience we will respond shortly.

          Comment


            #6
            Originally posted by Harry View Post
            The PriorDayOHLC indicator does not work correcly either, because it uses the flawed methods.

            I now remember that I have already reported this bug months ago, but nothing happened so far.
            Harry,

            PriorDayOHLC and CurrentDayOHL had been fixed by using a new method .GetTradingDayFromLocal(). .GetSessionBar() no longer should be used (as it is misleading). It would be great if you give the latest custom build a shot to see if the issues related are addressed. Please:
            - uninstall NT7 via control panel
            - install custom build from here: https://www.ninjatrader-support2.com...er.Install.msi

            Looking forward your feedback.

            Thanks in advance

            Comment


              #7
              Message received, will test it and come back with the results. Thank you.

              Comment


                #8
                GetTradingDayFromLocal() and PriorDayOHLC produced correct results

                Works as expected with CET (Central European Time), have not changed my
                system clock.

                Have tested GetTradingDayFromLocal() and PriorDayOHLC with a variety of instruments (including index, currency, energy and agricultural futures) and session templates (including templates with several sessions per day). Have also tested Bars.GetSessionDateFromLocal() with the chart session.

                All results were correct.

                Bars.GetDayBar() and Bars.GetSessionBar() display false results. Maybe it is better to remove them entirely.

                Bars.GetSessionDate() was no longer recognized by the compiler.


                Originally posted by NinjaTrader_Dierk View Post
                Harry,

                PriorDayOHLC and CurrentDayOHL had been fixed by using a new method .GetTradingDayFromLocal(). .GetSessionBar() no longer should be used (as it is misleading). It would be great if you give the latest custom build a shot to see if the issues related are addressed. Please:
                - uninstall NT7 via control panel
                - install custom build from here: www.ninjatrader-support2.com/ninjatrader/nt7.custom/NinjaTrader.Install.msi

                Looking forward your feedback.

                Thanks in advance

                Comment


                  #9
                  Thanks for checking, Harry.

                  Could you please elaborate why you fell .GetDayBar() and GetSessionBar() would not be working? Thanks

                  Comment


                    #10
                    GetSessionBar ignoring first bar of second intraday session

                    Let us start with GetSessionBar().

                    Below attached an indicator and a chart of ZC (corn futures) that shows false highs and lows for the prior day.

                    Also you can see that GetSessionBar() does not get the bar for the session but for both sessions. This in contradiction with its name.

                    Hint: The problem occurs with session templates that have several intraday sessions. When calculating high and low, GetSessionBar() ignores the first bar of the second intraday session. If the high or low of the day is made on that first bar of the second session, it is not taken into account.

                    Originally posted by NinjaTrader_Dierk View Post
                    Thanks for checking, Harry.

                    Could you please elaborate why you fell .GetDayBar() and GetSessionBar() would not be working? Thanks
                    Attached Files
                    Last edited by Harry; 09-02-2010, 09:04 AM.

                    Comment


                      #11
                      Thanks for pointing that out on the screenshot. We're looking into...

                      Also: You're right .GetSessionBar should not be used, since it's name is misleading. Please use .GetDayBar instead (has same issue as above though...)

                      Comment


                        #12
                        GetDayBar() similar

                        The problem with GetDayBar() is similar. First bar of the second session ignored, creating some false highs and lows.

                        Otherwise it displays the same values as GetSessionBar(). But the problem lies with GetSessionBar(), which should display the values for one session, but diplays daily values.
                        Attached Files

                        Comment


                          #13
                          Thanks. Again, please do NOT use GetSessionBar, it's misleading.

                          Comment


                            #14
                            Harry, I just uploaded a new custom build to same link as per below. Would you mind taking another look? Please don't forget to clear you browser cache before downloading. Thanks

                            Comment


                              #15
                              GetDayBar() works correctly

                              Tested GetDayBar() and for all my instruments and session templates it worked correctly.

                              Originally posted by NinjaTrader_Dierk View Post
                              Harry, I just uploaded a new custom build to same link as per below. Would you mind taking another look? Please don't forget to clear you browser cache before downloading. Thanks

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by rdtdale, Today, 01:02 PM
                              0 responses
                              1 view
                              0 likes
                              Last Post rdtdale
                              by rdtdale
                               
                              Started by alifarahani, Today, 09:40 AM
                              3 responses
                              15 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by RookieTrader, Today, 09:37 AM
                              4 responses
                              18 views
                              0 likes
                              Last Post RookieTrader  
                              Started by PaulMohn, Today, 12:36 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post PaulMohn  
                              Started by love2code2trade, 04-17-2024, 01:45 PM
                              4 responses
                              40 views
                              0 likes
                              Last Post love2code2trade  
                              Working...
                              X