Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

NT 6.5 vs 6.0 - Multi Time Frame Behavior

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

    NT 6.5 vs 6.0 - Multi Time Frame Behavior

    I have been using the following strategy to test the multi-time frame behavior of NT 6.5

    Code:
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] Initialize()[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
    [SIZE=2][FONT=Courier New]Add(PeriodType.Minute,[/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800080]877[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]);[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]CalculateOnBarClose = [/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
    [FONT=Courier New][SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#808080]<summary>[/COLOR][/SIZE][/FONT]
    [FONT=Courier New][SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000] Called on each bar update event (incoming tick)[/COLOR][/SIZE][/FONT]
    [FONT=Courier New][SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#808080]</summary>[/COLOR][/SIZE][/FONT]
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] OnBarUpdate()[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] (BarsInProgress == [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
    [SIZE=2][FONT=Courier New]Print([/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800000]"BarsInProgress == 0"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]);[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
     
    [FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] (BarsInProgress == [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
    [SIZE=2][FONT=Courier New]Print([/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800000]"BarsInProgress == 1 *************************************"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]);[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
    [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
    I have found that when Market Replay testing this strategy in a chart with minute intervals of anywhere from 1 minute to 480 minutes - if the PeriodType.Minute set in the Initialize() method is greater than 877 then the BarsInProgress == 1 condition is never true.

    This is also the case if the PeriodType is something greater than Minute, like Day.

    Again, this is not the same behavior found in NT 6.0.

    Thanks for your support.

    #2
    Thanks, we will have someone look into this.
    RayNinjaTrader Customer Service

    Comment


      #3
      I should ask...Do you have more than 877 minute bars of historical data and have you tested with the min bars required set to a low value? By default I think its 20 which means you would not get an OnBarUpdate() until you saw 20 * 877 minute bars which means you need at least 20 * 877 minute bars of historical data.
      RayNinjaTrader Customer Service

      Comment


        #4
        My bad... again. Sorry if I pulled someone off to chase this. You were right on the number here. I did have enough historical data... but I was setting the min bars required to 1 as I was not running any indicators... in an effort to speed up what I was testing. So, as you point out, I was basicly waiting until 877 minutes * 20 had been played through from my historical data before I started seeing the Print() statement from the BarsInProgress==1.

        I extened the Days Back Range Setting when starting my Market Replay and it worked as expected.

        However, I still can't get this to work if my PeriodType is Day in the strategy. With my days back setting at 50 I imediatly see the BarsInProgress==1 condition true with a PeriodType.Minutes = 1440 in the strategy. But I don't get the same result with a PeriodType.Day = 1

        I continue to just see the BarsInProgress==0.

        However, I assume at this point I am still doing something wrong.. I will continue to look at it and let you know.

        Thanks!

        Comment


          #5
          Try as I might...

          I still can't this to work. Using the simple Multi-time frame test strategy (attached) I cannot get a intra-day chart running a strategy with an added day time frame to work correctly.

          In the strategy I have added a PeriodType.Day time frame. When the strategy is run in an inter-day time frame (15 minute, 60 minute, etc.) the BarsInProgress==1 condition, which should be called for the day time frame, is never true.

          If my added time frame is also intra-day, then it works as expected.

          The reason I bring this up is I have test the same strategy, using the exact same Market Replay data file and the exact same history day in NT 6.0 on two differnet installations and in each case the day time frame BarsInProgress returns true.

          This behavior happens if CalculateOnBarClose = true or false

          Thanks for your time and help in this matter.
          Attached Files
          Last edited by kgillis23; 03-25-2008, 07:58 PM.

          Comment


            #6
            Josh will look into this tomorrow or Friday.
            RayNinjaTrader Customer Service

            Comment


              #7
              Wonderful - thank you.

              Comment


                #8
                Update:

                I belive I have been chasing the same issue on two different threads. (see my other thread under NT 6.5 vs 6.0 - Market Replay files )

                Dierk told me that my source for Market Replay data (GAIN) did not provide opening price data for a session and that consiquently my replay data would not have daily price data.

                I applied that insight to the strategy I have posted here - changing the added PeriodType from 1 Day to an equavalent 1440 Minute(s). Upon doing this the strategy works as expected, the BarsInProgress==1 condition returns true on each OnBarUpdate() call.

                So, again, I don't see why this would work in NT 6.0 and not 6.5. But with this additional information about GAIN I can move forward.

                Thanks for all your help.

                Comment


                  #9
                  I suspect you might have daily data already in your NT6.0 installation that allows it to work as you were hoping. In NT6.5 please try loading up some daily data with another data provider. Try Yahoo. They provide historical daily data you should be able to use.
                  Josh P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by merzo, 06-25-2023, 02:19 AM
                  10 responses
                  823 views
                  1 like
                  Last Post NinjaTrader_ChristopherJ  
                  Started by frankthearm, Today, 09:08 AM
                  5 responses
                  15 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Started by jeronymite, 04-12-2024, 04:26 PM
                  3 responses
                  43 views
                  0 likes
                  Last Post jeronymite  
                  Started by yertle, Today, 08:38 AM
                  5 responses
                  16 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by adeelshahzad, Today, 03:54 AM
                  3 responses
                  19 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Working...
                  X