Announcement

Collapse
No announcement yet.

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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        35 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        20 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        12 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        18 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        20 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X