• 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

internal time frame in strategy

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

    internal time frame in strategy

    so here on the ninjatrader forum y'all say to use a internal time frame in a strategy to simulate live market conditions.

    so i have done this and i'd like to better understand the results i am getting.

    external time frame 3min internal time frame 30seconds

    so one of the invariances i have figured out is that the internal time frame (yes i understand that i can change the which bar the indicators are looking at) changes both the lookback period and the onbarupdate.

    so is there anything else that i might be overlooking that could be an effect of adding an internal time frame to a strategy for backtesting?

    #2
    Hello jupiejupe,

    Thanks for the post. Unfortunately it is difficult to comment without seeing your strategy and a description of what you expect it to do. It would be best if you can share the strategy you're using here. Then please let us know your expectations with it, and if you're seeing results deviate from your expectations.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      it's my logic that i am trying to understand i understand that.

      what i am trying to understand is what the relationship is from the inner time to the outer time frame.

      the two things i can figure out is using the inner time frame cause the lookback period to change to the inner time frame.

      and onbarupdate also changes it's update frequency.

      but what other aspects have changed?? is there another invariant that changes for the chart time to the inner time frame?

      Comment


        #4
        I see, thanks for the reply. It's based on the time stamp of each series, and there is a different referencing model depending on whether you are working historically, or in real time with CalculateOnBarClose = false.

        This is detailed in the following link:
        http://www.ninjatrader.com/support/h...nstruments.htm
        See section: How Bar Data is Referenced

        Please have a look at that link and let me know if you have any questions.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          so what you are saying is that you personally have no idea. i understand that you personally might not know, but your answer is overly basic, you should be able to tell that from my question that i understand that bars are based on timestamps and that matter of fact that if the bar is set to true or false would impact the forward testing, but not in backtesting because of the engine.

          is there anyone that might know? if so could you earmark this for them?

          i can not model my strategy for forward testing if i do not understand what else is being changed by having a inner time frame added to a strategy.

          Comment


            #6
            The link to the documentation is offered as a starting point for the topic you requested information about. Please keep in mind we're trying to help you here, and we expect a civil tone.

            Timestamps of the bars are critical here as it's the basis for how bars in a multi series scripts interrelate.

            If you find the documentation difficult to follow and are looking for a practical approach to understanding this, please try with the following print statements:

            if (BarsInProgress == 0)
            Print("Primary Series " + Times[0][0] + " Secondary Series " + Times[1][0]);

            Then view in tools > output window, and you can see exactly how each bar is referenced in relation to the primary series. Try with BarsInProgress == 1 if you want to see how updates relate to each other with the secondary series.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_RyanM View Post
              Please keep in mind we're trying to help you here, and we expect a civil tone.
              yes that is why i have come here to ask my question, i ment no offense, i just bother by the overly basic answer that in my opinion did not match the level of the question asked.

              Originally posted by NinjaTrader_RyanM View Post
              Timestamps of the bars are critical here as it's the basis for how bars in a multi series scripts interrelate.

              If you find the documentation difficult to follow and are looking for a practical approach to understanding this, please try with the following print statements:

              if (BarsInProgress == 0)
              Print("Primary Series " + Times[0][0] + " Secondary Series " + Times[1][0]);

              Then view in tools > output window, and you can see exactly how each bar is referenced in relation to the primary series. Try with BarsInProgress == 1 if you want to see how updates relate to each other with the secondary series.
              i will add this to my script and see if there are any other lessons that i can learn about how nt7 is dealing with the internal bars.

              oh so there is no way to "Dynamically Change OnBarUpdate" because if it a timeframe was not initialized then it can not be changed?

              but if another strategy is wrapping a strategy, is it possible to stop and start the inner strategy changing the time frame from one period to another?

              Comment


                #8
                Correct, you could not dynamically / adaptively change the timeframe, it has to be added as bars object first via the Add() in Initialize().

                Strategies would per default not cross communicate, so I'm not exactly sure what you mean by one wrapping the other.

                You could though check for your conditions in different timeframes (for exampe as dictated by a filter) to adapt and then submit orders as needed.

                I'm not sure if you checked into it, but the SampleMultiTimeFrame would show some of those concepts, other than that the tip Ryan suggested is very valid - generously add Prints in your script conditions so you could identify the sequence seen, especially what BarsInProgress calls your script goes through - this would mean which bars object is calling the OnBarUpdate() method.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  thanks Bertrand

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by GLFX005, Today, 12:22 PM
                  2 responses
                  35 views
                  0 likes
                  Last Post NinjaTrader_Kate  
                  Started by AspenHiker, Today, 08:37 AM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_Kate  
                  Started by MartinT, Yesterday, 01:12 PM
                  2 responses
                  14 views
                  0 likes
                  Last Post MartinT
                  by MartinT
                   
                  Started by caveat_lector, Today, 11:58 AM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_Heath  
                  Started by Bionian, Today, 11:43 AM
                  1 response
                  8 views
                  0 likes
                  Last Post NinjaTrader_Kate  
                  Working...
                  X