Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Mixed time frames

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

    #16
    Have you tried what I posted in my last post?
    RayNinjaTrader Customer Service

    Comment


      #17
      Yes, from the tests I did, it occurred at midnight. Subsequent tests of GetSessionBar also refer to the YM

      Run without time constraint -
      28/02/2008 00:00:00 session close is: 12582.18 time 28/02/2008 00:00:00
      28/02/2008 00:01:00 session close is: 12526 time 28/02/2008 00:00:00

      Run with time constraint of after 16:00 and less than 16:03, I get
      28/02/2008 16:01:00 session close is: 12526 time 28/02/2008 00:00:00
      28/02/2008 16:02:00 session close is: 12526 time 28/02/2008 00:00:00

      Comment


        #18
        You will need to play around more. It works as expected indpendant of session settings.

        If you create a strategy with only the following code in OnBarUpdate() on one series you will see proof in the Output window.

        if (Bars.GetSessionBar(1) != null)
        Print(Time[
        0].ToString() + " " + Bars.GetSessionBar(1).Time + " " + Bars.GetSessionBar(1).Close);

        RayNinjaTrader Customer Service

        Comment


          #19
          Ray,

          Your code is for yesterday's (1) data. It doesn't update until midnight. It may work as expected but is not doing what is needed.

          Comment


            #20
            If today you run this code, it will return the close price from yesterday calculated from the intraday data.
            RayNinjaTrader Customer Service

            Comment


              #21
              Having some what of a similar problem but I am using Daily (primary) and weekly (secondary) data. Using Print() statements I see:

              2/29/2008 12:0:00AM[0]
              2/29/2008 12:00:00AM[1]
              3/3/2008 12:00:00AM[0]
              3/4/2008 12:00:00AM[0]
              3/5/2008 12:00:00AM[0]
              3/6/2008 12:00:00AM[0]

              This is running the Strategy Analyzer on Sunday, March 9th. As you can see, there is no daily entry 3/7/2208 or a weekly entry for 3/7/2008. Looks like it will not consider Friday to be complete until Monday's data has been added.

              I have played around with the session parameters and that has not gotten NT to consider Friday to be complete. I double checked the chart and the chart is showing a daily bar for 03/7/2008.

              Is there something I'm missing or is this the way NT works?

              Thanks

              Comment


                #22
                When CalculateOnBarClose is set to true (which is the setting for backtesting) it will not include the final bar because it does not know that it has "closed" yet. This is the way NT works with historical data. In real-time you can set CalculateOnBarClose to false and you will get prints on the final bar.
                Josh P.NinjaTrader Customer Service

                Comment


                  #23
                  Ray,

                  I set the daily data up as 1 minute at 4 pm (160000). I then accessed the data as minute data and NT obliged. Obviously not the correct solution but it will do for the time being.

                  e.g.
                  20080228 160000;12689.28;12713.99;12463.32;12582.18;3938580
                  20080229 160000;12579.58;12579.58;12210.3;12266.39;4426730

                  Eric

                  Comment


                    #24
                    Excellent
                    RayNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    628 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
                    568 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X