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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          134 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          75 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          119 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          114 views
          1 like
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          92 views
          0 likes
          Last Post CarlTrading  
          Working...
          X