Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator with Indicator as Input Series

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

    Indicator with Indicator as Input Series

    I want to point to a change in the architecture of NinjaTrader 8 when compared to NinjaTrader 7, which is an advantage, but makes it necessary to recode indicators in a different fashion.

    I am talking about the behaviour when an indicator is selected as input series for an indicator. This is the main difference between NinjaTrader 7 and NinjaTrader 8

    NinjaTrader 7: When an indicator is selected as input series, Open, High, Low, Close, Median, Typical and Weighted are remapped to Input.

    NinjaTrader 8: Open, High, Low, Close, Median, Typical and Weighted will always return price data, irrespective of the selected input series.

    NinjaTrader 8 has a huge advantage here, as it is possible to access both the input series the underlying price data without adding a secondary bar series. Well designed.

    However, this makes it necesary to recode some of the indicators, which currently do not work on an indicator. Actually, this has already been done for the Swing and the ZigZag indicator, The Swing indicator checks the input series, and then performs calculations accordingly as needed. The ZigZag indicator has an option which is compatible with indicators as input series.


    Problem:

    The following indicators cannot be used, when an indicator is selected as input series:

    - ADX
    - ADXR
    - Aroon
    - Aroon Oscillator
    - ATR
    - CCI
    - DM
    - DMI
    - Double Stochastics
    - Parabolic SAR
    - RVI
    - Stochastics
    - Stochastics Fast
    - Ultimate Oscillator
    - WilliamsR

    For other indicators it does not make sense to select an indicator as input series. In this case an error message should be displayed, if an input other than price data is used. This would apply to

    - BOP
    - Chaikin Money Flow
    - Chaikin Oscillator
    - Keltner Channel
    - RIND
    - Range

    I did not check all indicators in detail, but I have probably caught the most obvious candidates. With NinjaTrader 7 it was possible to use the first group with other indicators as input series. It is necessary to make these indicator available again for use on indicators.

    The best known example is probably the StochRSI, which is calculated by applying a Stochastics to a RSI. This indicator even comes as a default indicator with NinjaTrader. It is quite common to apply the Stochastics to other oscillators, which was possible with NinjaTrader 7, but which cannot be done with NinjaTrader 8.

    Also CCI, Double Stochastics, WilliamsR can not be applied to other indicators with NinjaTrader 8. The chart below shows the Aroon Oscillator applied to a CCI with NinjaTrader 7. This results in improved signals. Again, this cannot be done with NinjaTrader 8.

    It s pretty easy to modify the code of the listed indicators to allow for applying them to other indicators. Why not simply do it?
    Attached Files
    Last edited by Harry; 09-30-2016, 02:59 PM.

    #2
    Hello Harry,

    To confirm, you saying that Input in NinjaTrader 8 is no longer functioning, is this correct?

    "An ISeries<double> type object that implements the Series<double> interface. Accessing this property via an index value [int barsAgo] returns a double value representing the price of the referenced bar."
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you for responding.

      No, I am not saying that Input is no longer functioning. I am saying that

      - there is "a change in the architecture" (see below)
      - "NinjaTrader 8 has a huge advantage" versus NinjaTrader 7

      NinjaTrader 8 simply does not remap Open, High, Low, Close, Typical, Median and Weighted to Input.

      This is good but makes it necessary to change the code of a few indicators to allow for using them with indicators as input series. Please read again. I have explained it in my first post.

      You have already modified the Swing indicator as needed. What I ask for is that you make similar modifications for the other indicators that I have listed. Otherwise there will be an unnecessary code breaking change between NT7 and NT8.


      Originally posted by NinjaTrader_ChelseaB View Post
      Hello Harry,

      To confirm, you saying that Input in NinjaTrader 8 is no longer functioning, is this correct?

      "An ISeries<double> type object that implements the Series<double> interface. Accessing this property via an index value [int barsAgo] returns a double value representing the price of the referenced bar."
      http://ninjatrader.com/support/helpG...n-us/input.htm
      Last edited by Harry; 09-30-2016, 03:28 PM.

      Comment


        #4
        Hello Harry,

        I may not be understanding correctly. If you were to reference the High for a script, the Input should provide values of the high. If it doesn't, the input would not be functioning correctly.

        Can you confirm if you supply the High to an indicator, that the High is not the input?

        If not, can you clarify what the issue is with an example?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Chelsea,

          This is not correct.

          With NinjaTrader 8, if I reference the High for a script, it will always provide the High from the price data, not from the selected input series. In fact this is a great improvement and is a change by design.

          This change makes it necessary to recode a few indicators. Please have a look at the Swing indicator, where this change has already been implemented.

          Here is the relevant code section:
          Code:
                      double high0        = Input is Indicator ? Input[0] : High[0];
                      double low0           = Input is Indicator ? Input[0] : Low[0];
          As you can see the change to the code is pretty easy to do.

          Originally posted by NinjaTrader_ChelseaB View Post
          Hello Harry,

          I may not be understanding correctly. If you were to reference the High for a script, the Input should provide values of the high. If it doesn't, the input would not be functioning correctly.

          Can you confirm if you supply the High to an indicator, that the High is not the input?

          If not, can you clarify what the issue is with an example?

          Comment


            #6
            Example

            Let me try to explain with a simple example:

            When you select the RSI as the Input Series for the Stochastics

            -> NinjaTrader 7 will display the Stochastic RSI
            -> NinjaTrader 8 will ignore the RSI and simply display the Stochastics calculated from price data

            This behaviour can be easily changed by modifying the code for the Stochastics (see code attached).

            All other indicators can be modified in a similar fashion to work with the selected input series.
            Attached Files

            Comment


              #7
              Hello Harry,
              Originally posted by Harry View Post
              With NinjaTrader 8, if I reference the High for a script, it will always provide the High from the price data, not from the selected input series. In fact this is a great improvement and is a change by design.
              I think I am understanding your meaning. With NinjaTrader 7, if the Input Series is set to an indicator specifically, all data series such as the OHLC will return the value of the input series (the value of the indicator) and will not return the underlying dataseries' high, low, or close.

              You are wanting to return this behavior where the underlying data series is not available as it has become available in NinjaTrader 8.

              I have submitted a feature request on your behalf to change this.

              (That said, I've tested selecting the High as the input series instead of an indicator and when doing this the OHLC are actually available in NT7.)
              Last edited by NinjaTrader_ChelseaB; 10-03-2016, 10:50 AM.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_ChelseaB View Post
                That said, I've tested selecting the High as the input series instead of an indicator and when doing this the OHLC are actually available in NT7.
                Yes, it is possible to select the High as the input series, but it is not possible to access the High programmatically, when an indicator is seleceted as the input series.

                Comment


                  #9
                  I have run into this as well. The issue is there is no way to tell if the price data has been overridden, so you can not make the simple switch that Harry mentions. For example, you can not do something like
                  Code:
                  bool InputIsIndicator = Input == Close;
                  which would allow the code to infer whether the Open/High/Low should be overridden with Input. Ideally this would just be an Indicator flag that could be queried by the code.

                  As it stands now, there are many indicators that do not produce correct results as Harry has pointed out.

                  This major change in function should also be documented somewhere.

                  Comment


                    #10
                    Originally posted by aslane View Post
                    I have run into this as well. The issue is there is no way to tell if the price data has been overridden, so you can not make the simple switch that Harry mentions. For example, you can not do something like
                    Code:
                    bool InputIsIndicator = Input == Close;
                    which would allow the code to infer whether the Open/High/Low should be overridden with Input. Ideally this would just be an Indicator flag that could be queried by the code.

                    As it stands now, there are many indicators that do not produce correct results as Harry has pointed out.

                    This major change in function should also be documented somewhere.
                    All indicators produce correct results, when a price series is used as input. Some indicators will not work when an indicator series is used as input.

                    You can easily select the Input as a replacement for High, Low, Close etc. In this case you need to programmatically check, whether the input series is a price series. You will then need to adjust the code depending on the input series.

                    Please have a look at the code of the swing indicator and the sample indicator that I have posted.

                    Comment


                      #11
                      Hello Harry,

                      Your request to add support for the OHLC values to all be mapped to the Input value when Indicators are the Input Series for other Indicators is being tracked with ID# SFT-1606.

                      Please let me know if you have any other features or suggestions you would like me to submit on your behalf.
                      Last edited by NinjaTrader_ChelseaB; 11-09-2016, 04:00 PM.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_ChelseaB View Post
                        Hello Harry,

                        Your request to add support for the OHLC values when Indicators as the Input for Indicators is being tracked with ID# SFT-1606.

                        Please let me know if you have any other features or suggestions you would like me to submit on your behalf.
                        Thank you very much for your effort.

                        Comment


                          #13
                          @NinjaTrader_ChelseaB

                          @NinjaTrader_Paul

                          I've been using NT7 successfully for several year and am in the process of switching to NT8. I use a Heiken Ashi indicator within a strategy and have found in NT8 that when I nest an indicator, as in use another as the input series for the HA that it crashes my system. The indicator can be found at this link on the NT forum site.

                          http://ninjatrader.com/support/forum/local_links.php?s=&catid=7&filter=&sort=n&page=1&p p=20&keyid=643

                          When applied to a chart or used within a strategy without nesting the input series it works great but falls apart and crashes when nested. Is this a result of the issues you have written about.

                          I'm also not a programmer so making any changes would be impossible for me to accomplish. If it is as you have described could a programmer make the changes quickly?

                          Paul.....Any familiarity with these issues? If it is applicable could you make the changes needed?

                          Thanks again for participating and helping the community.

                          GuppyDRV

                          Comment


                            #14
                            Hello GuppyDRV,

                            When you say nested, do you mean the chart has the HeikenAshi bar type applied and the HeikenAshi indicator is also added?

                            Do you mean that an indicator is calling the HeikenAshi indicator?

                            Do you have a small code example you've exported to demonstrate the issue?
                            Chelsea B.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Aviram Y, Today, 05:29 AM
                            0 responses
                            2 views
                            0 likes
                            Last Post Aviram Y  
                            Started by quantismo, 04-17-2024, 05:13 PM
                            3 responses
                            27 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Started by ScottWalsh, 04-16-2024, 04:29 PM
                            7 responses
                            34 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Started by cls71, Today, 04:45 AM
                            0 responses
                            6 views
                            0 likes
                            Last Post cls71
                            by cls71
                             
                            Started by mjairg, 07-20-2023, 11:57 PM
                            3 responses
                            218 views
                            1 like
                            Last Post PaulMohn  
                            Working...
                            X