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

Indicator Sequence Caclulation Logic

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

    Indicator Sequence Caclulation Logic

    Working with historical data I'd like to know approximately what is the logic that determines the sequence of the calculation of few indicators on the same chart for both NT7 and NT8 ?
    Just for an analysis I am doing I'd like to have the indicator "b" to calculate after the indicator "a".
    Thank you.

    #2
    Hello giogio1,

    Individual indicators applied to the chart don't have a specific load order, there would not be a way to make sure one indicator loads after another.

    In NinjaScript if you want items to process in a certain way you would have to call that item in code. For example If indicator A calls indicator B in code indicator B would need to calculate to return a value so indicator A can use it, this has nothing to do with manually applied indicators in a chart those will still load independently.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank You Jesse,
      and if I have two indicators that both paint the bars with a certain color, does the placement on the indicators list of the chart determine which one paints first?
      Best
      G

      Comment


        #4
        Hello giogio1,

        The placement does not make a difference, it would depend on which loads last. If indicator A loads very quickly and paints bars then indicator B loads slowly and paints bars you would be seeing indicator B on top. If you need two separate indicators to paint bars in a certain way you would usually have to combine those indicators into one so that you can make conditions that draw the correct color based on which calculation was true/false.

        JesseNinjaTrader Customer Service

        Comment


          #5
          Thank you!!
          Is the speed influenced behavior true also during backtesting when I am not connected? This is the case that I am interested in.
          Best!
          G

          Comment


            #6
            Hello giogio1,

            If you mean manually added to a chart then yes, those indicators would be like the example i provided. Whichiver processes first will be drawn first.

            If you are adding indicators to the chart using the strategy then also yes the separate visual instance that is loaded would depend on when it loads in contrast to the other indicators.

            In scripting usage no, the order you call the indicators would be the order they calculate prices to provide back to the strategy.

            JesseNinjaTrader Customer Service

            Comment


              #7
              Thank you Jesse,
              Yes I mean manually placed on the chart.
              In case of NT8 where we have multithread processing your example is perfectly understandable and thank you for it !
              In Historical mode, not connected, In the case of NT7 , debugging it what I see is that one indicator on a 500 bars chars is calculated all the 500 bars first, then it goes on the next indicator and calculates all 500 bars again for the second indicator and so on.
              For this one I have hard time to understand why speed should be a factor. There seems more the position of the list but it is not clear the logic.
              I wander if it is because I forgot to specify this situation or because I am completely wrong in my understanding.
              Best
              G

              Comment


                #8
                Hello giogio1,

                In general manually applied indicators have no specific load order, there is nothing documented listing a expected order that they would load. If you are trying to accomplish some specific rendering or order that the indicators process you should avoid doing that and instead combine those indicators into one so that they have logic for those tasks. When you migrate to NT8 that will still be important as there is no defined load order in that version either so the answer would still be the same.

                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Thank you Jesse!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by DJ888, Today, 10:57 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by MacDad, 02-25-2024, 11:48 PM
                  7 responses
                  158 views
                  0 likes
                  Last Post loganjarosz123  
                  Started by Belfortbucks, Today, 09:29 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post Belfortbucks  
                  Started by zstheorist, Today, 07:52 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post zstheorist  
                  Started by pmachiraju, 11-01-2023, 04:46 AM
                  8 responses
                  151 views
                  0 likes
                  Last Post rehmans
                  by rehmans
                   
                  Working...
                  X