Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to call other indicators from code

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

    How to call other indicators from code

    I need one indicator to get the value of another one in the OnBarUpdate code. I'm having trouble with a particular (licensed and locked) indicator that keeps returning 0 as its value.

    I can get values from these other indicators:

    Standard indicator EMA(9)[0].ToString() = 1.33744268334864
    Custom indicator SAFqt(9)[0].ToString() = 1.33678766781693

    but this indicator returns 0 every time:
    MA_Multicolor(2, 30, mAType, 30, 9)[0].ToString() = 0

    This is a moving average indicator like the other two. I can't look at the source code because it's licensed. But I should be able to use the above statement to get its value, shouldn't I?

    Bryan

    #2
    Hello Bryan,

    Seems like the indicator developer is using the following.



    Let me know if any questions.

    -Brett
    BrettNinjaTrader Product Management

    Comment


      #3
      OK, thanks, you're probably right. Although the properties and methods from the indicator do appear when I just type in MA_Multicolor. and it then displays the possible values after the dot.

      Comment


        #4
        Yep, sounds about right. In either case we would need access to code to further isolate unfortunately.

        -Brett
        BrettNinjaTrader Product Management

        Comment


          #5
          When calling an indicator that has the ChartOnly property set to true, I get an error message:

          "Error on calling 'OnBarUpdate' method for indicator 'aa' on bar 0: The indicator 'AATestIndicator' is intended for visualization and can only be used on a chart."

          So I'm not sure that is the problem in this case, with it returning 0.

          VT

          Comment


            #6
            Originally posted by VTtrader View Post
            When calling an indicator that has the ChartOnly property set to true, I get an error message:

            "Error on calling 'OnBarUpdate' method for indicator 'aa' on bar 0: The indicator 'AATestIndicator' is intended for visualization and can only be used on a chart."

            So I'm not sure that is the problem in this case, with it returning 0.

            VT
            Hm... yeah, I don't get that message. But I'm still out of luck if it returns 0 every time.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            152 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            89 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            131 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            127 views
            1 like
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            107 views
            0 likes
            Last Post CarlTrading  
            Working...
            X