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

Problem with indicator input as input to another indicator

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

    Problem with indicator input as input to another indicator

    Hello,

    I am sure I must be doing something silly here, but not quite sure what!

    I have an indicator with 2 plots. I want to take values from the 2nd, as per the attached image, and use that in another of my indicators. The indicator takes Input[0] (which I would assume is this value), but it is not. Instead of the bar values, I get this

    -34545
    -31270
    -31250
    -35161
    -35175
    -31897
    -31900

    An I honestly am not sure where that data is coming from! The indicator works OK with other price series data I've tested it on.

    As you can see from the image. The correct plot is selected as the input series data source. Should not Input[0] be these values?

    I hope this is clear enough. Can you put me on the right track?

    Many thanks.

    #2
    Hi pjsmith, thanks for your note.

    The spread indicator uses the Close values of the primary series to calculate the spread instead of Inputs. If you want a spread of some indicator value and another dataseries this will need to be calculated from Inputs instead of Closes.

    Kind regards.

    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi Chris,

      Thanks for the reply. I think I didn't quite explain correctly. I want to use the output of the spread indicator (the plot), as the input to another indicator. So, not plotting the spread of some indicator, but an indicator calculating on the plot of the spread indicator.

      Does that make more sense? Possible?

      Thanks.

      Comment


        #4
        Hi pjsmith,

        I was able to set this up. I added an SMA indicator, for the input series I selected spread with the input series for spread set to Close, and the additional symbol required for the spread.

        See this short clip I made: https://clauber.tinytake.com/tt/Mzg2MDU0Ml8xMTgxMTY0MA

        If that is not working in your scenario could you describe what you're trying to set up?
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          OK - Thanks. I can see it clearly works for you in the example. Maybe I've messed this up. What I did, is slightly modify the spread indicator - It now has 2 plots. I want the 2nd as input to my own indicator, which how the config is in the original image. In the image, you can see I have set the 2nd plot as the input to to my indicator, but when I access Input[0] in my indicator, which uses the 2nd plot in the spread indicator as it's input series, it does not contain the values I expect.

          Comment


            #6
            Hi pjsmith, thanks for your reply.

            It's not possible to specify an additional input for one plot through the user interface. An indicator can take one input specified in the Input Series field. If you needed to set the extra plot to the value of your indicator you would need to instantiate the indicator in the modified spread indicator and set Values[1][x] to "CustomInidcator[0]".
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Hi - Looking at the original image, isn't that what I did though? In the input series, I specified the second plot of the spread indicator and expected that to be available as Input[0] in the parent indicator. . Will that not work? To be clear, I only need 1 plot or the other from the modified spread indicator, not both. I am specifying the relevant one in the input series of the indicator I am trying to get to read that plot.

              Comment


                #8
                Hi pjsmith, thanks for your reply.

                It seems like this should work. Could you provide a reduced sample that re-creates the problem? I will be happy to test it out.
                Chris L.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks. Unfortunately, I gave up on this as it clearly was not working for me, for whatever reason. My reason for making 2 plots is I wanted an option of an up / down bar, instead of a running spread total as it were. I've modified my spread indicator back to single plot and just changed the logic to vary that plot depending on a 'plotAsBars' flag. With a single plot, it works as an input to other indicators. I'd like to have known why the other did not as I am sure to come across it again, but the code for this one is changed and working now.

                  Comment


                    #10
                    Hi pjsmith, thanks for your reply.

                    I would need a sample to test to know exactly what's going wrong there. I'm glad you were able to find an alternate solution.

                    Please let me know if I can assist with anything else.
                    Chris L.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by PhillT, Today, 02:16 PM
                    2 responses
                    3 views
                    0 likes
                    Last Post PhillT
                    by PhillT
                     
                    Started by Kaledus, Today, 01:29 PM
                    3 responses
                    9 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by frankthearm, Yesterday, 09:08 AM
                    14 responses
                    47 views
                    0 likes
                    Last Post NinjaTrader_Clayton  
                    Started by gentlebenthebear, Today, 01:30 AM
                    2 responses
                    14 views
                    0 likes
                    Last Post gentlebenthebear  
                    Started by PaulMohn, Today, 12:36 PM
                    2 responses
                    17 views
                    0 likes
                    Last Post PaulMohn  
                    Working...
                    X