Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi timeframe and multi trading hours

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

    Multi timeframe and multi trading hours

    Hello,

    I am using market replay to test indicator performance. I am using market replay data that I have downloaded previously. I am using NT8.

    I am adding a few data series' to an indicator. The last one does not work as expected. The indicator associated with the 4th data series (BarsArray[3]) never enters OnBarUpdate(). The problem exists no matter what indicator I associate with BarsArray[3].

    I am missing something. Any help is appreciated.

    Code below.

    Code:
    protected override void OnStateChange() {
    ...
    else if (State == State.Configure)
    {
    AddDataSeries(BarsPeriodType.Tick, 133);
    AddDataSeries(BarsPeriodType.Tick, 1200);
    AddDataSeries("ES 06-21", new BarsPeriod { BarsPeriodType = BarsPeriodType.Day, Value = 1 }, "US Equities RTH", null);
    }
    else if (State == State.DataLoaded)
    {
    MacdEnv1 = Macd(BarsArray[0],12,26,9);
    MacdEnv2 = Macd(BarsArray[1],12,26,9);
    MacdEnv3 = Macd(BarsArray[2],12,26,9);
    PriorHighLow = PriorDayOHCL(BarsArray[3]);
    ...
    }

    Thanks!​

    #2
    In order for OnBarUpdate to be run, it has to have plots and you have to refer to them. If you're using a test indicator, does your test indicator meet that criterion?

    You can also force it to run OnBarUpdate even if the platform does not think it needs to by calling .Update() on that indicator instance.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Hello zimbabwe,

      Thank you for your post and welcome to the NinjaTrade forum community!

      So I may accurately assist you, please answer all of the following questions:
      • What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)
      • What instrument symbol (and expiry if applicable) have you selected as the primary instrument? For example, ES 03-22, AAPL, EURUSD, etc.
      • (For a chart) what interval is selected? For example, 5 minute, 1 day, 2000 volume, 4 Renko, etc.
      • What date(s) are you playing back in market replay? What time range are you looking at?
        • I ask this because the series in question is for ES 06-21 using the US Equities RTH trading hours. I am curious if data exists for ES 06-21 for the dates and time of day you are looking at.
      • Do you receive an error on the screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?

      I look forward to your reply.

      Comment


        #4
        Bruce and Emily, thank you for your replies.

        Bruce, Using the .Update() method worked beautifully. You were correct, I was not plotting from that particular indicator nor did I want to, so I used the .Update() method to force an update.

        Emily, here is the info you were looking for, though my problem is solved now. Next time I post, I will include this info.
        Version: 8.0.24.2 64-bit
        Instrument: ES 6-21
        Date + time: 5/14/2021, 11:56AM
        Interval: 400tk, 133tk, 1200tk, 1 hr.
        No errors on the console, but my debugging printouts identified the issue.

        -Zamir

        Comment


          #5
          Hello Zamir,

          Thank you for your reply. I am glad to hear this was resolved!

          I do want to notify you that you are using an older version of NinjaTrader. To update to the latest version of NinjaTrader Desktop, 8.1.1.3, or the previous version (8.0.27.1) please follow the steps below.
          • Login into the NinjaTrader Account Dashboard
          • Click "Download" in the bottom left-hand corner of the sidebar
          • Next select "Download" in the "Most Recent Release" Window in the main screen
            • Optionally, you may select version 8.0.27.1 from the Prior Releases on the right-hand side
          • Once the installation had downloaded, ensure any previous version of NinjaTrader is closed before running the installation package.
            • Note: You may need to locate this in your "Downloads" folder in a Windows File Explorer
          For more details on what is different between each version, please see the release notes in the help guide at the following links:
          Please let me know if I may be of any further assistance.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          666 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          377 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          110 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          575 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          580 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X