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 Hwop38, 05-04-2026, 07:02 PM
          0 responses
          173 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          328 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          252 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          354 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          181 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X