Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculation precedence

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

    Calculation precedence

    Ninja Support team - have couple of questions related to potential calculation precedence of the charts ( not considering the multiple instrument charts but single instrument - individual charts).

    - Let's say I have 2 charts ( 5 min & 1 min )
    - Wanted to take a value calculated on 5 and use it on 1 min chart
    - would it be possible to define some kind of precedence to the calculation logic where the study performs calculation on 5 minute chart first and then on 1 min chart?

    For example - a tick arrives at 10:00:00.001 - Would like to have this tick processes on 5 minute chart FIRST ( and calculate a summary value "X" (global value) on 5 minute chart).

    Now I would like to use the summary value "X" on the same tick - 10:00:00.001 on 1 minute chart.

    Does the current NT8 architecture allows me to define such "precedence" of charts calculations?

    If not - are there any alternatives?

    thanks

    #2
    Hello vking,

    Thanks for your post.

    With an indicator you can add a data series to the calculation logic and then define the calculation order based on which bar series called the OnBarUpdate() method. You can write your code based on a chart with 1 minute data series and in your indicator you can add a 5 minute dataseries and then be able to refer to either dataseries as needed. For example, if (BarsInProgress == 0) { process all of the logic associated with 1 minute bars}; if (BarsInProgress == 1) { process all the logic associated with 5 minute bars}.

    Alternatively when BarsInProgress == 0 you can reference the 5 minute data and vice versa with the BarsInProgress == 1.

    For clarity of these concepts, please review the multitimeframe section of the helpguide: http://ninjatrader.com/support/helpG...nstruments.htm it is best to read each section in order to understand the progression of the concepts and examples.

    Comment


      #3
      Paul - Thanks for the reply.

      The current issue with MTF chart is this:

      let's say - you have 1 minute base chart and 5 minute data is added through indicator.

      Let's say a tick arrives at 10:00:00.001 ( this tick would be applicable for both 1 minute chart & 5 minute chart ).

      I don't have a way to process this same tick "first" on 5 minute chart and then process the calculated values in 1 minute chart.

      As the procesing engine always processes BarsInProgress == 0 first and then BarsInProgress == 1 irrespective of the order in which the code is written.

      Pseudo code:

      // 5 minute data
      if (BarsInProgress == 1 ) - calculate some values - 10.00.00.001 tick data gets processed here

      //1 minute data
      if (BarsInProgress == 0 ) - use the calculated data from 5 minute chart (10.00.00.001 tick data WON't be available here as this part of the code actually gets executed first for the same tick).

      Any potential solutions available?

      Thanks



      This is the problem with NT 7 and same is the case with NT 8.

      Was hoping if there is a way to calculate the data for the same tick first on 5 minute chart & then use that data for the SAME tick on 1 minute chart.

      thanks

      Comment


        #4
        Hello vking,

        Thanks for your reply.

        Regrettably there is no means to force the calculation of 5 minute chart before the 1 minute chart, thus there is no solution.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        671 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 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
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X