Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug in Bars.FirstBarOfSession

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

    Bug in Bars.FirstBarOfSession

    Hi,
    There is a bug in this property.
    When the time stamp of a bar is 00:00:00 it is recognized as a FirstBarOfSession but so is the bar with time stamp greater then 00:00:00.
    Attached is a debug example.

    Baruch
    Attached Files

    #2
    Baruch, thanks for reporting in - could you please share your code snippet so I could reproduce here?

    If you look for the first OnBarUpdate() call of the new session please use FirstBarOfSession in tandem with FirstTickOfBar.

    Comment


      #3
      Bertrand hi,
      I get this error in backtesting. There is no FirstTickOfBar. Back testing runs OnBarUpdate() only once per bar.
      To reproduce it you need to run on ES on 1 Tick Data series. (because ES has many ticks and some dates ticks with time stamp 00:00:00)
      Just print something in
      If (Bars.FirstBarOfSession)
      {
      print something
      }

      Baruch

      Comment


        #4
        Baruch, thanks this is a bug which will be fixed in NT7.

        Comment


          #5
          N7.18 Not recognizing FirstBarOfSession

          Hi.... I have a strategy that runs ok on N6.5, but N7.18 never recognizes FirstBarOfSession nor SessionBreak

          Any idea o suggestion?

          Thanks

          Comment


            #6
            Please try using Bars.FirstBarOfSession and Bars.SessionBreak -



            Comment


              #7
              Bertrand, the two expressions - Bars.FirstBarOfSession and Bars.SessionBreak - are exactly what I've tried in the code and it doensn't work. In the following code snipet, the strategy never enters neither expression:


              // Resets the highest high and lowest low at the start of every new session
              Print("Bars.FirstBarOfSession"+Bars.FirstBarOfSess ion);
              Print("Bars.SessionBreak"+Bars.SessionBreak);
              //if (Bars.FirstBarOfSession)
              if (Bars.SessionBreak)
              {
              Print("Bars.SessionBreak"+Bars.SessionBreak);
              Print("Bars.FirstBarOfSession"+Bars.FirstBarOfSess ion);

              highestHigh = High[0];

              lowestLow = Low[0];
              barraInicio = CurrentBar;
              startBar = 0;

              I am getting the following error message in the output window:
              **NT** Error on calling 'OnBarUpdate' method for strategy 'TSP_1/a1e4c574a1d74601a0bb77ebdbfd7280': Reference to object has not been established as an instance of an objet Referencia a objetono establecida como instancia de un objeto.
              8/2/2010 10:08:11 AM CancelAllOrders: BarsInProgress=0

              The translation to English is mine. It may not coincide exactly with the original English version text.

              Thanks
              Last edited by rperez; 08-04-2010, 07:50 PM.

              Comment


                #8
                This is likly not triggering as your OnBarUpdate() processing encounters an issue trying to access an empty object - can you please strip the strategy down to using only the two session related calls you attempt to test and then retry without other code interfering?

                Thanks

                Comment


                  #9
                  Thanks... fixed it!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  649 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  370 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  109 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  573 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  576 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X