• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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?
    BertrandNinjaTrader Customer Service

    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);
        BertrandNinjaTrader Customer Service

        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.

            http://www.ninjatrader.com/support/h...BarsInProgress
            BertrandNinjaTrader Customer Service

            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).
                BertrandNinjaTrader Customer Service

                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 aslane, Today, 01:29 PM
                    1 response
                    8 views
                    0 likes
                    Last Post aslane
                    by aslane
                     
                    Started by itrader46, Today, 01:09 PM
                    0 responses
                    5 views
                    0 likes
                    Last Post itrader46  
                    Started by elnoppo, Today, 12:38 PM
                    1 response
                    6 views
                    0 likes
                    Last Post NinjaTrader_Kate  
                    Started by TradingRocks, Today, 11:44 AM
                    1 response
                    10 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by Brillo, Today, 11:39 AM
                    2 responses
                    11 views
                    0 likes
                    Last Post Brillo
                    by Brillo
                     
                    Working...
                    X