Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator on Indicator

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

    Indicator on Indicator

    I have defined an indicator 1 and another indicator 2 that takes in the indicator 1 as the primary time series. Indicator 1 takes in 1 minute bars time series as the primary input series. What is the best way to plot the indicator 2 and provide it the indicator 1 as input? I am able to plot indicator 2 with 1 minute bars for example as input in a separate panel with the bar chart. thanks

    #2
    Newworldguy,

    Thank you for your post.

    You can add the Indicator 2 to the chart and change the input series to use Indicator 1.
    To do this, follow the step below –

    1. From your chart open the Indicators Window, Right click in the chart and select Indicators
    2. If you haven't already add Indicator 2 by selecting the indicator on the left list and click new.
    3. To the right will be parameters for that Indicator.
    4. Under ‘Data’ change the Input series by clicking in and then the ‘…’ button that appears to the right.
    5. This will bring up the Input Series window.
    6. Double click Indicators and select Indicator 1. Below you can change the parameters of the indicator if you want
    8. Click OK.
    9. Click Apply and then OK
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      I did exactly what you said. As a result now Indicator 2 is using Indicator 1 as the primary input series. In the code of indicator 2, I was using the Time function to access the time series. When I used the ES 06-14 1 m bars as the input series, indicator 2 worked just fine. Now when I use Indicator 1 as the input series, The Time function returns a NULL. Do i have to create the Time Array in my Indicator 2 code? If so please, can you share an example? thanks,

      Comment


        #4
        newworldguy,

        Can you please attach your script and what you are doing inside it
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Script attached.

          Please advice. thanks

          This is of course Indicator 2 that takes in indicator 1 as an input. The 2 calls that are problematic as far as I can see are Time and Volume. Since I am passing an indicator to the indicator as input series which is more than an IDataSeries, I am wondering if I have to do something to the effect of:

          protected override void OnBarUpdate()
          {

          Indicator indicatorInput = (Indicator)Input;

          and then:

          if(index != -1)
          {
          aatod += indicatorInput.Volume[index];

          before making these calls...?

          In general it will be good to post an example of an indicator that takes in an indicator as an input, I cannot currently find one. And the wizard doesn't seem to support an indicator as an Input type.
          Attached Files
          Last edited by newworldguy; 05-08-2014, 10:22 PM. Reason: Additional information

          Comment


            #6
            Find attached the code for Indicator 1 (FlowStats.cs) and Indicator 2 (AverageAtTimeOfDay.cs) and the dll(NinjaCompanion) that is referenced.


            Look forward to your assistance.
            Attached Files

            Comment


              #7
              Simple Test

              To simplify the matter I created the following test using the wizard and just changed 2 lines in TestIndicatorOnindicator.cs:


              protected override void OnBarUpdate()
              {

              Print(Time[0].ToString());
              Plot0.Set(Volume[0]);

              attached are screenshots and output window. neither time nor volume worked as i expected...

              Can you please suggest how I can get this simple example to work? In other words, how can I access the underlying time series and of of TestIndicator1 and the volume of the input to the TestIndicator1 (which is 1 min ES 06 bars)
              Attached Files

              Comment


                #8
                Newworldguy,

                Try using this setup with the code instead.

                So, for the TestIndicatorOnIndicator change the Plot0.Set to

                Code:
                Plot0.Set(TestIndicator1(High, 1)[0]);
                This will use the TestIndicator and use the High price series for the calculations
                Cal H.NinjaTrader Customer Service

                Comment


                  #9
                  Cal,

                  This still plots the close and not the high. did you try it? Also any suggestions on my original question, i.e. can I pass an indicator to an indicator as the primary series?

                  Comment


                    #10
                    in fact it doesn't matter what i set the plot in IndicatorOnIndicator to:

                    Plot0.Set(TestIndicator1(Volume, 1)[0]);

                    Will also print the Plot set in TestIndicator1!

                    Comment


                      #11
                      Newworldguy,

                      Apologies, you will need to change the value for Plot0 from the first indicator to Input[0]. I tested this out and it will give the correct price series that you pass through
                      Cal H.NinjaTrader Customer Service

                      Comment


                        #12
                        ok. that works. so that leaves me with my original question.

                        Comment


                          #13
                          Yes, you would want to have Input[0] for both indicators in this setup and then use the same method from Post #2
                          Cal H.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                          0 responses
                          648 views
                          0 likes
                          Last Post Geovanny Suaza  
                          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                          0 responses
                          369 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by Mindset, 02-09-2026, 11:44 AM
                          0 responses
                          108 views
                          0 likes
                          Last Post Mindset
                          by Mindset
                           
                          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                          0 responses
                          572 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by RFrosty, 01-28-2026, 06:49 PM
                          0 responses
                          573 views
                          1 like
                          Last Post RFrosty
                          by RFrosty
                           
                          Working...
                          X