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

Bars skipped in multi time frame strategy

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

    Bars skipped in multi time frame strategy

    Hello,
    to simplify the question i will drop all unnecessary details.
    If I run a strategy (maximum bars look back = Infinite) on 1 main time frame for "ES 06-15" 1 day instrument, and I use CalculateOnBarClose = false, I get the OnBarUpdate() method called 91 times,
    from:
    DateTime: 10/02/2015 22:15:00,
    BarsInProgress: 0,
    CurrentBar: 1,

    until:
    DateTime: 18/06/2015 22:15:00,
    BarsInProgress: 0,
    CurrentBar: 91,

    all together 91 bars, 91 times. all good.
    but if I add another time period -
    Add(PeriodType.Minute, 300); // (or any other amount of minutes)
    suddenly I get the first 80 bars on the main instrument ignored -
    from:
    DateTime: 03/06/2015 22:15:00,
    BarsInProgress: 0,
    CurrentBar: 80,

    until:
    DateTime: 18/06/2015 22:15:00,
    BarsInProgress: 0,
    CurrentBar: 91,

    now my question is, why because i added another time frame, i lost the OnBarUpdate() being called on the first 79 bars of the main instrument?

    thank you

    #2
    This problem cries out for some example code.

    Do you have a toy strategy that you can attach?

    Comment


      #3
      Hello,
      I have not been able to reproduce this scenario on my end.
      Would you be able to attach a sample strategy that reproduces what you are seeing on your end?
      I look forward to your reply.
      Cody B.NinjaTrader Customer Service

      Comment


        #4
        there's really nothing to the code more than ive described

        like i said, the main bars object is set on a chart of ES 06-15 daily



        protected override void Initialize()
        {
        CalculateOnBarClose = false;
        BarsRequired = 1;
        Add(PeriodType.Minute, 300);
        }

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
        Print(string.Format(@"
        DateTime: {0},
        BarsInProgress: {1},
        CurrentBar: {2},",
        Time,
        BarsInProgress,
        CurrentBar));
        }

        Comment


          #5
          Thanks for the code example.

          Just to be clear, is this NT7 or NT8?

          Comment


            #6
            NT7, simulated data feed

            Comment


              #7
              Originally posted by dadomil View Post
              NT7, simulated data feed
              Ah, I see. Well, as they say on the TV show 'Shark Tank' -- I'm out.

              [Why? My interest plummeted to zero because, IMHO, simulated data feed isn't worthy of the expectation of the level of performance you're looking for. I mean, I know what you're asking, sure, but if this was happening in market replay, or realtime or historical data during backtest, I'd be deeply scared something was really wrong. But with simulated data feed, there is no red flag, IMHO, just a very light pink flag, so my concern has dropped to zero. Phew. I can now relax and watch the Super Bowl. The NT support guys can decipher the true importance of this issue and help you much better than I can. Good luck.]

              Comment


                #8
                Hello,
                Do you have historical minute data saved on your PC for the number of days you are loading on your chart? This can be found in the Historical Data Manager under the Edit Tab. For more information on using the Historical Data Manager please see the following link: http://ninjatrader.com/support/helpG...t7/editing.htm
                Cody B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bmartz, 03-12-2024, 06:12 AM
                4 responses
                31 views
                0 likes
                Last Post bmartz
                by bmartz
                 
                Started by Aviram Y, Today, 05:29 AM
                4 responses
                11 views
                0 likes
                Last Post Aviram Y  
                Started by algospoke, 04-17-2024, 06:40 PM
                3 responses
                28 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by gentlebenthebear, Today, 01:30 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by cls71, Today, 04:45 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X