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 Instance

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

    Indicator Instance

    Hello guys, I have a question about creating an indicator instance from another indicator. I already know that if I create multiple instances of indicator B within indicator A with the same parameters, Ninjatrader will only create one instance of indicator B to save memory. But, if say, I create an instance of B from both indicator A and C with identical parameters, will the same thing happen?

    Thanks!

    #2
    Are you saying you want to have an indicator A and indicator A creates an instance of indicator C which then creates an instance of Indicator B? You can certainly do this if that is the question.

    This thread might be of help as well: http://www.ninjatrader.com/support/f...ad.php?t=56301

    Additionally this example: http://www.ninjatrader.com/support/f...ead.php?t=4991
    LanceNinjaTrader Customer Service

    Comment


      #3
      My question is that if I create an instance of B in indicator A and create another instance of B in indicator C, and the arguments of both B instances are the same, then will Ninjatrader create only one instance of B for both A and C or will it create two instances of B for A and C separately? What I m thinking is that I wanna create, say, ten indicators(x1...x10) and all of them need to reference an indicator Y. In this case, will Ninja creates only one instance of Y for x1...x10 to share or will it creates 10 separate instances( which use 10 times the memory space or computing power) for each x1...x10? Note that I am saying that the arguments to call Y in x1...x10 are identical. So theoretically only one instance of Y is needed. However, I don't how Ninja deal with this situation in real-time

      Comment


        #4
        Hello,

        Thank you for clarifying.

        In this case each script would have it's own instance even if they had the same inputs.

        If indicator Y called indicator Z ten times with the same settings it would only have once instance of Z
        If indicator X called indicator Z twenty times with the same settings it would only have one instance of Z

        There would be a total of two instances of Z

        Let me know if I can be of further assistance.
        LanceNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Kaledus, Today, 01:29 PM
        2 responses
        7 views
        0 likes
        Last Post Kaledus
        by Kaledus
         
        Started by frankthearm, Yesterday, 09:08 AM
        13 responses
        45 views
        0 likes
        Last Post frankthearm  
        Started by PaulMohn, Today, 12:36 PM
        2 responses
        16 views
        0 likes
        Last Post PaulMohn  
        Started by Conceptzx, 10-11-2022, 06:38 AM
        2 responses
        55 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Started by yertle, Yesterday, 08:38 AM
        8 responses
        37 views
        0 likes
        Last Post ryjoga
        by ryjoga
         
        Working...
        X