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

Calling another indicator with different TimeFrames

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

    Calling another indicator with different TimeFrames

    Hi,

    I have an Indicator (A) where I call another indicator (B).
    This B indicator gives a signal through a Plot.
    This B indicator has 2 TimeFrames.

    My question is: must I load these 2 TF from indicator B in the "State.Configure" from my indicator A?
    The B indicator is, of course, loading its own 2 TF in its "State.Configure" -> indicator B works properly from alone.

    How does it work?

    Thanks!​

    #2
    Hello artson,

    Yes, both indicators must have the same calls to AddDataSeries() in State.Configure.

    "Should your script be the host for other scripts that are creating indicators and series dependent resources in State.DataLoaded, please make sure that the host is doing the same AddDataSeries() calls as those hosted scripts would. For further reference, please also review the 2nd example below and the 'Adding additional Bars Objects to NinjaScript' section in Multi-Time Frame & Instruments​"

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Ok, thanks,

      And must be these AddDataSeries() in State.Configure in both indicators in the same order?

      Imagine this time, I have a master indicator A, calling to 2 different "slave" indicators B and C.
      B has 2 TF and C has 2 other different TFs.

      Must I load the AddDataSeries() in State.Configure in A in an order, or is indifferent?

      Comment


        #4
        Hello artson,

        The calls to AddDataSeries don't have to be in the same order, they just need to be added to both.

        Indicator A would need to have all 4 data series added.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks Chelsea!!

          Comment


            #6
            Ok, and one more question

            If in Indicator A I want the result from Indicator B in TF 2 (lets say 15 min), which is the TF from indicator A, when I should call this indicator B?, the TF from A corresponding to 15 min?

            or inside the indicator A, I allways call to B from TF 0 (default TF) because the indicator B will automathicaly calculate it inside it?
            (difficult to explain)

            Comment


              #7
              Hello artson,

              Any public plot series from an indicator will be synchronized to the primary data series. While you can add a data series and use this for calculations, the plots themselves that would be returning information to a host would be doing so when the primary series updates. The added secondary data series could be setting plot values, but those values will be updated for the host when the primary series updates.

              An example of using a higher time frame data series to set values for a lower time frame primary series may clarify.
              HigherTimeFrameIndicatorPlotExample - https://ninjatrader.com/support/foru...196#post820196
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by cshox, 12-12-2023, 06:39 PM
              5 responses
              228 views
              0 likes
              Last Post JuanErnesto  
              Started by abandonedBaby, 06-12-2024, 12:08 PM
              5 responses
              22 views
              0 likes
              Last Post abandonedBaby  
              Started by AaronKoRn, Today, 08:44 PM
              0 responses
              7 views
              0 likes
              Last Post AaronKoRn  
              Started by trader252, Today, 08:32 PM
              0 responses
              6 views
              0 likes
              Last Post trader252  
              Started by Randy Hotcakes, Today, 08:10 PM
              0 responses
              8 views
              0 likes
              Last Post Randy Hotcakes  
              Working...
              X