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

Passing Indicator Input to another Indicator

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

    Passing Indicator Input to another Indicator

    In NT7 there was a nice built-in mechanism to pass input from one indicator to another indicator. For example, to smooth out a CCI indicator I could pass an EMA value of that same indicator.

    As an example, the Input Series from NT7 would look like: EMA($AUDUSD (30 Min),5)
    to the standard CCI indicator.

    NT8 allows that same type of Input Series but it seems like it ignores the smoothing that I am trying to apply.

    Is that something that others have run into ? If so, what is the best way to accomplish this without having to write custom indicators ?

    #2
    Hello Greg1, and thank you for your question. In NinjaTrader 8 it was decided to make indicator series work only on price inputs to some indicators. To work around this, I have submitted a feature request to the product management team for the following feature :
    This customer would like a user to be able to select the mapping for each input value to an indicator
    I will follow up with more information as soon as it's available. If the feature requests already exists, a vote will be added to it.


    Please let us know if there are any other ways we can help.
    Last edited by NinjaTrader_JessicaP; 03-13-2017, 02:56 PM.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Hello Jessica,

      This is the subject that we have been discussing in two other threads. I am not starting the discussion all over, but will just refer to the threads:

      http://ninjatrader.com/support/forum...ad.php?t=90105 (main thread)


      The CCI is one of the indicators that cannot be used with an input series other than price.

      I have an easy fix available as I did for the Stochastics.


      "In NinjaTrader 8 it was decided to make indicator series work only on price inputs."

      And this is definitely not correct. With the exception of a few indicators which have not been correctly coded, all others can be used with an input other than price data.
      Last edited by Harry; 03-13-2017, 02:48 PM.

      Comment


        #4
        Hello Greg1,

        If you need a CCI that can be used on an indicator, please send me a private message with your e-mail and I will send it to you.

        I will also make it available here shortly.

        Comment


          #5
          Originally posted by NinjaTrader_JessicaP View Post
          In NinjaTrader 8 it was decided to make indicator series work only on price inputs.
          As time goes by, this is becoming more and more a monumentally idiotic and breathtakingly stupid decision.

          What was the rationale behind that restriction?

          Originally posted by NinjaTrader_JessicaP View Post
          If the feature requests already exists, a vote will be added to it.
          Please add my vote for this feature.

          Comment


            #6
            Originally posted by Harry View Post
            And this is definitely not correct. With the exception of a few indicators which have not been correctly coded, all others can be used with an input other than price data.
            Thank you Harry, I have amended my post.
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by bltdavid View Post
              As time goes by, this is becoming more and more a monumentally idiotic and breathtakingly stupid decision.

              What was the rationale behind that restriction?
              I think this was just a misunderstanding. Of course, NinjaTrader 8 is designed to pass an indicator as input series to another indicator.

              There has even been a major improvement. Open, High, Low, Close, Median, Typical and Weighted are not remapped to Input. This allows for accessing both indicator values (indicator as input series) and price values in parallel.

              I hope that you understand that this is a huge advantage!

              All default indicators that ship with NinjaTrader and which only call the input series can already be used with an indicator as input series. There are only a few indicators that need to be recoded. Just adding a few lines of code is sufficient. I have already recoded ADX, ADXR, ATR, CCI and Stochastics. I anyone needs them please let me know.

              No big problem here, there is an easy fix.

              Comment


                #8
                Hello Greg1 and bltdavid,

                This feature is being reviewed by the product management team and has been assigned the following unique tracking ID


                SFT-1606


                Please let us know if there is any other way we can help.
                Jessica P.NinjaTrader Customer Service

                Comment


                  #9
                  I wanted to see if there was any update on this. It looks like I have to switch to NT 8 because of a forex change coming in May and this is a feature that was in NT7. I've been holding off on switching to NT8 because of the lack of this built-in capability.

                  Comment


                    #10
                    Thank you for your question and interest in NT8, Greg1. I'm happy to inform you that there was a misunderstanding on my part which forums user Harry helped to clear up. As you can see from the attached indicators, when you pass HS1675598Inner as input to HS1675598Outer , you will receive output similar to this, demonstrating that the outer indicator has access both to the inner indicator's returned value, and to the data series' OHLC values.
                    Code:
                    {
                    Input[0] : 100.00
                    Open[0] : 2669.50
                    High[0] : 2671.00
                    Low[0] : 2669.00
                    Close[0] : 2670.75
                    }
                    Indicators such as Stochastics have already been updated to reflect this change.

                    Should you encounter any places where your incoming data series do not meet these expectations, please submit a new request to platformsupport[at]ninjatrader[dot]com, and one of our staff will be happy to answer any further questions we may.
                    Attached Files
                    Jessica P.NinjaTrader Customer Service

                    Comment


                      #11
                      Selecting an indicator as input series

                      I think that there is still a major misunderstanding here:

                      The difference between NinjaTrader 7 and NinjaTrader 8 is that in case that you selected an indicator as input series

                      -> NinjaTrader 7 remaps Open, High, Low and Close to the indicator input series
                      -> NinjaTrader 8 does not remap Open, High, Low and Close to the indicator input series

                      Therefore - always talking about an indicator selected as input series

                      Close[0] will hold the indicator value with NinjaTrader 7
                      Close[0] will hold the close of the price bar with NinjaTrader 8


                      Major advantage for NinjaTrader 8

                      You may simultaneously access the indicator values and the prices from within the same script without adding a secondary bar series! Imagine you wish to code a divergence indicator which works on both price and indicator series. You may easily collect the needed information High, Low, Close (prices) and Input (indicator values) via the Script.


                      No feature request

                      I have never requested any additional feature. The default indicators for NinjaTrader 8 have just not been adapted to the new architecture. Actually you need to adapt all the indicators that use other inputs than "Input" such as "High", "Low", "Close" or "Typical". We have already adapted most indicators to work with NinjaTrader 8 and made them available in our library at www.lizardindicators.com.


                      Example: CCI

                      Attached is a modified version of the CCI which works with any indicator as input series as is expected by NinjaTrader users. Greg, please download the indicator and check for yourself. The indicator first detects whether it runs on a price or an indicator series. In a second step, the indicator will either use Typical (in case that it runs on a price series) or Input (in case that it runs on an indicator).

                      Such an easy fix is possible for all NinjaTrader default indicators. I think there about 15 of them that need to be modified.


                      Example: Stochastics

                      Jessica, the Stochastics has not been adopted to work with other input series than price. If you let it run on an indicator it will exactly produce the same output when running on price.
                      Attached Files
                      Last edited by Harry; 04-23-2018, 09:21 AM.

                      Comment


                        #12
                        I appreciate you following up Harry. To make sure we are all on the same page, I am going to post an excerpt containing one of the differences between @CCI.cs and amaCCI.cs

                        @CCI.cs
                        Code:
                                    else if (State == State.DataLoaded)
                                        sma  = SMA(Typical, Period);
                        amaCCI.cs
                        Code:
                                        if(Input is PriceSeries)
                                        {
                                            calculateFromPriceData = true;
                                            sma  = SMA(Typical, Period);
                                        }
                                        else
                                        {
                                            calculateFromPriceData = false;
                                            sma  = SMA(Input, Period);
                                        }
                        And this demonstrates the operation of the new calculateFromPriceData switch (emphasis mine)
                        Code:
                                        if(calculateFromPriceData)
                                        {    
                                            for (int idx = Math.Min(CurrentBar, period - 1); idx >= 0; idx--)
                                                mean += Math.Abs([B]Typical[idx][/B] - sma0);
                        
                                            CCI[0] = ([B]Typical[0][/B] - sma0) / (mean.ApproxCompare(0) == 0 ? 1 : (0.015 * (mean / Math.Min(period, CurrentBar + 1))));
                                        }
                                        else
                                        {    
                                            for (int idx = Math.Min(CurrentBar, Period - 1); idx >= 0; idx--)
                                                mean += Math.Abs([B]Input[idx][/B] - sma0);
                        
                                            CCI[0] = ([B]Input[0][/B] - sma0) / (mean.ApproxCompare(0) == 0 ? 1 : (0.015 * (mean / Math.Min(period, CurrentBar + 1))));
                                        }
                        I understand the above to mean that if we have an input indicator, the expectation is we should take values from the input indicator, rather than underlying price series. This expectation would cause our NT8 indicators to match NT7 indicators more closely, and from a certain perspective, is more intuitive; it is reasonable to expect something operating on top of an SMA to take data from that SMA, as otherwise there is no apparent purpose to feeding an SMA instead of a data series into an indicator.

                        Harry, I would appreciate your reading the previous paragraph and clearing up any remaining misunderstandings should any be apparent.

                        Greg1, if the above is all correct, you can download Harry's modified indicators from the pages Harry has linked if you would like to have your NinjaTrader 8 indicators work exactly as NinjaTrader 7's indicators have done. The functionality you are requesting is therefore already available to you.

                        If all of the above is correct and resolves everyone's queries, the remaining question is whether NinjaTrader 8's indicators should be modified with the above paragraph in mind. Our product management team is still reviewing the costs and benefits to this approach against user demand. Greg1, I have added a vote on your behalf to this request. Please bear in mind that there are other considerations, such as development of new indicators that have always had access to OHLC data at development time (as opposed to merely converting an NT7 indicator in this case). Bear in mind that the current operation is more stable, since any indicator can be passed into one of our tools, and also bear in mind the Input series exists to explicitly allow indicator inputs where those would be desirable.

                        Should we implement the changes Harry has recommended, we will notify users of this fact in the release notes page here,


                        Please let us know if there are any other ways we can help.
                        Last edited by NinjaTrader_JessicaP; 04-23-2018, 10:19 AM.
                        Jessica P.NinjaTrader Customer Service

                        Comment


                          #13
                          I vote that NinjaTrader should do exactly what Harry is suggesting.

                          All indicators in NT8 need to able to accept another indicator as input (any experienced NT7 user would assume this about NT8 as a matter of course), so those indicators in NT8 that don't already allow this by default need to be updated to be made "input-series aware" -- just like Harry's amaCCI example.

                          It makes perfect sense (esp when the NT8 codebase already provides features to automatically detect the underlying source of the 'Input' data series) that *all* NT8 indicators be updated, that is, Harry has shown that an indicator can be made smarter about using 'Input' as the NT7 era caller would have intended, without breaking the newer advantages that NT8 provides.

                          It seems like a no-brainer, a monumentally good thing, that these NT8 indicators be updated as Harry advises.

                          It's a pure win-win for everybody ... how can anyone disagree?

                          Comment


                            #14
                            Originally posted by bltdavid View Post
                            All indicators in NT8 ...
                            I would amend this to mean "all indicators in NT8 that previously existed in NT7".

                            I would suggest that the NT8 version of the NT7 standard indicator explicitly allow for price series inputs or indicator inputs.

                            New NT8-only standard indicators (that did not previously exist in NT7) can do whatever makes the most sense, those indicators don't necessarily need to follow this mantra -- Why? because brand new NT8-only indicators don't have a builtin legacy of NT7 users expecting certain standard builtin capabilities.

                            Comment


                              #15
                              Originally posted by NinjaTrader_JessicaP View Post
                              I understand the above to mean that if we have an input indicator, the expectation is we should take values from the input indicator, rather than underlying price series. This expectation would cause our NT8 indicators to match NT7 indicators more closely, and from a certain perspective, is more intuitive; it is reasonable to expect something operating on top of an SMA to take data from that SMA, as otherwise there is no apparent purpose to feeding an SMA instead of a data series into an indicator.

                              Hi Jessica,

                              Thank you for summarizing!

                              This is exactly what I meant to say and what many NinjaTrader users do expect.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by algospoke, Today, 06:40 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post algospoke  
                              Started by maybeimnotrader, Today, 05:46 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post maybeimnotrader  
                              Started by quantismo, Today, 05:13 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post quantismo  
                              Started by AttiM, 02-14-2024, 05:20 PM
                              8 responses
                              168 views
                              0 likes
                              Last Post jeronymite  
                              Started by cre8able, Today, 04:22 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post cre8able  
                              Working...
                              X