Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Passing an instance of an indicator to another one

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

    Passing an instance of an indicator to another one

    I need to pass the instance of my indicator to another indicator. I do this by calling a method on the second indicator and pass "this".

    i2.init(this);

    It works fine when everything is in .cs files.

    When I compile indicator 2 (i2) into a protected assembly, then I get casting errors:

    "Cannot convert from Ninjatrader.Indicator.Indicator [.. @ADL.cs] to Ninjatrader.Indicator.Indicator [.. mydll.]

    It seems compiling the protected assembly changes something and there are now two separate Ninjatrader.Indicator.Indicator classes, one for the .cs files and one for the dll.

    Is there a way to fix this problem?

    #2
    cunparis,

    Are you trying to pass a single value from one indicator to the next? Or are you looking to add (nest) the entire indicator from one to another?

    If you are looking to pass a value, please refer to our reference sample on Exposing indicator values that are not plots:

    MatthewNinjaTrader Product Management

    Comment


      #3
      I'm looking to pass the indicator instance so that I can access its properties & methods from the other one.

      I know this may sound crazy but I have very good reasons for doing this (which I could explain but I don't want to overcomplicate the question).

      Comment


        #4
        cunparis,

        Thanks for the clarification - I'll have someone more experienced with this follow up with you on Monday.
        MatthewNinjaTrader Product Management

        Comment


          #5
          cunparis, I don't believe we can support this but would like to doublecheck, could you please email me a sample to run and look into to support at ninjatrader dot com?

          Thanks in advance,

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          579 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X