Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Analyzer appears to recycle from start to end date?

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

    Strategy Analyzer appears to recycle from start to end date?

    Why does the following happen?
    When running the strategy analyzer and printing the date to the output window at every entry to onbarupdate, I expected dates to appear for every day and only once and then the run would cease ... sequentially from time frame start to end date. However the start to end date cycle is repeated, accompanied by a few other additional confusing aspects. I can live with it but would like to know why.

    #2
    Joe, which exact print statement are you then using now in OnBarUpdate() to see the date/timestamp?

    Comment


      #3
      for the indicator---
      public string format1="MM/dd/yyyy HH:mm";
      public string format2="HH:mm";
      Print(
      "entered LV3indicator OnBarUpdate"
      +" "+Time[0].ToString(format1)
      +
      "//"+Time[0].ToString(format2)
      +
      " "+Time[0].DayOfWeek);

      for the strategy---
      public string format1="MM/dd/yyyy HH:mm";
      public string format2="HH:mm";
      Print("entered LV3strategy OnBarUpdate"
      +" "+Time[0].ToString(format1)
      +
      "//"+Time[0].ToString(format2)
      +
      " "+Time[0].DayOfWeek);

      Comment


        #4
        Thanks. Which timeframe are you testing on? OnBarUpdate() is called for each bar, so each bar in the day will trigger this print then. To see the sequence better, add for example the CurrentBar processed info in -

        Print("entered LV3strategy OnBarUpdate" +" Bar " + CurrentBar + " " +Time[0].ToString(format1) +"//"+Time[0].ToString(format2) +" "+Time[0].DayOfWeek);

        Comment


          #5
          the time frame is one day however the indicator [written for me by Lance] works with two time frames to make getdaybar work the way I want it to. I have no idea how or what he did. but it does not seem like that would cause the recycling thru the start/stop time frame window.

          see attachments
          Attached Files

          Comment


            #6
            Would the strategy use an additional timeframe internally? If it did then your print would be called for each series, thus duplicate calls could be expected for this print. You could filter that with BarsInProgress to only have the primary for example hit this condition.

            Comment


              #7
              per post #1
              "Why does the following happen?
              When running the strategy analyzer and printing the date to the output window at every entry to onbarupdate, I expected dates to appear for every day and only once and then the run would cease ... sequentially from time frame start to end date. However the start to end date cycle is repeated, accompanied by a few other additional confusing aspects. I can live with it but would like to know why."

              so I think I understand that duplicate calls should be expected as the analyzer run progresses. my question is ... why does the analyzer run from start date to end date, and then repeats that cycle?

              Comment


                #8
                Duplicate calls would also be seen for the historical part for sure, even more so if multiple instruments are tested for example in a basket test or optimization then (here multiple instances of the same script would be used).

                Comment


                  #9
                  duplicate calls make sense to me, no prob there. that is not my concern. I just still don't understand why the analyzer runs from start date to end date more than once? but no matter, I think the print to output window as it is will serve my debugging/checking/tracing purposes.

                  Comment


                    #10
                    it works ok now... no longer a concern.
                    don't know what fixed it but it's fixed.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    111 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    59 views
                    0 likes
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    38 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Started by TheRealMorford, 03-05-2026, 06:15 PM
                    0 responses
                    41 views
                    0 likes
                    Last Post TheRealMorford  
                    Started by Mindset, 02-28-2026, 06:16 AM
                    0 responses
                    78 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Working...
                    X