Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    cassb
    NinjaTrader Ecosystem Vendor - Logical Forex

    #2
    Hello Bryan,

    Seems like the indicator developer is using the following.



    Let me know if any questions.

    -Brett

    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.
      cassb
      NinjaTrader Ecosystem Vendor - Logical Forex

      Comment


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

        -Brett

        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.
            cassb
            NinjaTrader Ecosystem Vendor - Logical Forex

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            3 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            18 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            1 view
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            6 views
            0 likes
            Last Post Javierw.ok  
            Started by timmbbo, Today, 08:59 AM
            2 responses
            10 views
            0 likes
            Last Post bltdavid  
            Working...
            X