Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

referencing an indicator in an indicator

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

    referencing an indicator in an indicator

    Does anyone know how to reference an indicator in a different indicator. For example suppose I have an oscillator indicator "A" that is rising and falling above and below the zero line.

    I would like to reference that indicators value on each bar in indicator "B" and if it is above zero I want it to do xyz and if below zero I want it to do abc.

    Indicator "B": if (Close[0] of Indicator "A" > 0 then ... xyz) else abc


    Any thoughts on this.

    Thanks

    #2
    You can reference any indicator in any other indicator. For examples please check out the Help Guide. Search up any indicator for the syntax. Search for maybe SMA or EMA or RSI. They will show you what to type to use them.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh,

      I searched under help and did not find anything of value. Could you give me a little more guidance.

      thanks.

      Comment


        #4


        Here is the link for SMA. There is an example of how you can use it in coding. This is available in both NinjaScript Indicators and NinjaScript Strategies.

        To fit along with your pseudocode would be something like the following:
        Code:
        if (Close[0] > SMA(20)[0])
        {
             // Do something;
        }
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I understand what you are saying. However, MyCustom Indicator has 10 different Plot values and I am trying to reference one of the plot values in a different indicator.

          How do I do that without recreating the indicator?

          thanks

          Comment


            #6
            When you created the plots you gave it a name. You access the plots by their names.

            Take a look at the MACD indicator. It has several plots and you can see how it is accessed via the example in the Help Guide. http://www.ninjatrader-support.com/H...deV6/MACD.html

            Notice the Avg and Diff plots being accessed.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Just looking at this thread, I think the question was this:

              If there are two indicators, one in panel 2 and the other in panel 3, how would they interact? Is it possible?
              eDanny
              NinjaTrader Ecosystem Vendor - Integrity Traders

              Comment


                #8
                Indicators interact however you program them to interact. You don't need them in any panel for them to interact. When you code if you wanted your Moving Average indicator to interact with the MACD indicator you would just call the MACD indicator in the MA indicator itself. You would reference whichever plot you are interested in for whatever calculation you are trying to run.
                Josh P.NinjaTrader Customer Service

                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