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

RSI Recent Plots

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

    RSI Recent Plots


    Try to find when RSI plot is Greater than the Lowest RSI Value in the Last 10 Periods

    I tried to Plot a Donchian channel on a chart in the lower area shared with RSI plot, with the Donchian channel input being the RSI indicator (this will not plot correctly on the Chart, but will it work to plot the RSI High and RSI Low for the last 10 Periods?

    if(RSI(14, 3)[0] >

    Thanks

    Example Donchian channel

    DonchianChannel2 = DonchianChannel(RSI1.Default, 10);

    && (DonchianChannel2.Lower[1] < RSI1.Default[0]))


    Last edited by DTSSTS; 12-22-2022, 10:37 AM.

    #2
    Hello DTSSTS,

    Thank you for writing in.

    Some of the system indicators in NinjaTrader 8 default to the Close data series as input, even if you select an indicator as the input series. The Donchian Channel is one of those indicators. That being said, we have made a variant of that indicator that will allow you to use an indicator as input. Please import the following Donchian Channel variant indicator which may be used in place of the default system Donchian Channel indicator in your example:
    DonchianChannelInputSample_NT8.zip

    Please let us know if we may be of further assistance.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Thanks Very Much, I am sure this will be downloaded by Many Traders,

      Merry Christmas to all the NinjaTrader Staff

      Comment


        #4
        Emily I have an issue trying to use the DonchianChannelInput indicator in a Strategy

        an error is created when trying to compile: Strategy.DonchianChannelInput(int) is a "method" but is used like a "type"
        private DonchianChannelInput DonchianChannelInput1;

        I think this resolved
        private NinjaTrader.NinjaScript.Indicators.InputSeriesVari ants.DonchianChannelInput DonchianChannelInput1;
        Last edited by DTSSTS; 12-23-2022, 07:50 AM.

        Comment


          #5
          Hello DTSSTS,

          Thank you for your note.

          Yes, it looks like using the fully qualified namespace when declaring the indicator should resolve the error your were receiving.

          Please don't hesitate to reach out with any additional items we may assist you with.
          Emily C.NinjaTrader Customer Service

          Comment


            #6
            Emily I am attempting to use the DonchianChannelInput I am compiling my strategy without issues but when I attempt to backtest my strategy, without the new condition using the DonchianChannelInput I have results and not issues, when I add condition using the DonchianChannelInput I have an error in the log

            Its the OLD error on calling OnBarUpdate method on bar 4. You are accessing an index with a value that is invalide since it is out of range. IE accessing a series [barsago] with a value of only 4 bars on the chart.

            DonchianChannelInput1.Upper[10] with this set to 10 bars ago is issue blocks all trades with the error

            DonchianChannelInput1.Upper[0] does not work either, but it does not block all trades as it does not create the error, but any condition set with the 10 bars ago will not execute

            Bars required to trade is set to 20

            Any Helpful input appreciated
            DTS
            Last edited by DTSSTS; 01-31-2023, 03:51 PM.

            Comment


              #7
              Hello DTSSTS,

              Thank you for that information.

              Based on the condition you are adding, you may need to add a CurrentBar check to make sure there are enough bars in the data series. This is described on the following help guide page:


              Typically, you will need to make sure there are at least as many bars as the Period value for the indicator. For example, if the period is 14, you would need to add a check similar to the following:
              if (CurrentBar <= 14)
              return;

              Please let us know if we may be of further assistance.
              Emily C.NinjaTrader Customer Service

              Comment


                #8
                Thank You that was the issue. I do not know why when you add a condition set to the strategy builder that needs the CurrentBars to be changed that it does not change them. After adding the Same condition set to the strategy builder CurrentBars < 3 was still in the view code. But when In my unlocked version I changed increase the current bars as you suggested that was the fix for my issue

                Thanks Again

                Comment


                  #9
                  Originally posted by NinjaTrader_Emily View Post
                  Hello DTSSTS,

                  Thank you for writing in.

                  Some of the system indicators in NinjaTrader 8 default to the Close data series as input, even if you select an indicator as the input series. The Donchian Channel is one of those indicators. That being said, we have made a variant of that indicator that will allow you to use an indicator as input. Please import the following Donchian Channel variant indicator which may be used in place of the default system Donchian Channel indicator in your example:
                  [ATTACH]n1228665[/ATTACH]

                  Please let us know if we may be of further assistance.
                  Emily can you tell me if the

                  Lin Reg Intercept is ONE of the system indicators that will work with Other indicators at the Input

                  I am trying to use it in that fashion and even though I see plots I still am not sure remains effect/accurate all the time

                  I think I could use SMA if I had too. Just looking to know about the Lin Reg Intercept

                  Thanks
                  DTSSTS
                  Last edited by DTSSTS; 05-11-2023, 07:18 AM.

                  Comment


                    #10
                    Hello DTSSTS,

                    Thank you for your note.

                    Yes, the LinReg indicator allows for any input, such as other indicators. You do not need a modified script to use an indicator as input for LinReg. To check the values and compare, you could add print statements that compare the value of LinReg with the primary data series as input vs. LinReg with an indicator as input.

                    Please feel free to reach out with any additional questions or concerns.
                    Emily C.NinjaTrader Customer Service

                    Comment


                      #11
                      Emily I have another the Lin Reg Slope, It appears to be working but the measures are so small hard to be sure, I have prints on my strategy but when I use conditions set some times no trades and small changes it will work. But then in back testing with a date range of a few months suddenly I will only see trades for a few days and then the backtest shows no more results (tested on multiple start dates) So only thing different is the use of this indicator in the condition sets. So with the odd behavior I wanted to reach out to see if this Indicator input can be another indicator

                      Thanks again

                      Comment


                        #12
                        Originally posted by DTSSTS View Post
                        Emily I have another the Lin Reg Slope, It appears to be working but the measures are so small hard to be sure, I have prints on my strategy but when I use conditions set some times no trades and small changes it will work. But then in back testing with a date range of a few months suddenly I will only see trades for a few days and then the backtest shows no more results (tested on multiple start dates) So only thing different is the use of this indicator in the condition sets. So with the odd behavior I wanted to reach out to see if this Indicator input can be another indicator

                        Thanks again
                        Hello DTSSTS,

                        Thank you for the additional information.

                        Since you are only seeing trades for a few days and then no more results, I suggest checking the Log tab of the Control Center for error messages. You may also enable TraceOrders in your strategy to see if there are any orders being ignored for any reason. You may also need to check if you get the same kind of behavior when backtesting the SampleMaCrossover strategy for the same date range with similar settings. If you are only seeing trades for the same few days then no additional results, this may be related to the data available for the backtest. There is a Strategy Analyzer property if you right-click and select Properties to "Use local data only" that can have an impact on results - it will only use data stored in the local repository rather than using your data provider connection to download the necessary historical data for the date range of the test. You may need to check that this box is unchecked and try the test again.

                        Please let us know if we may be of further assistance.
                        Emily C.NinjaTrader Customer Service

                        Comment


                          #13
                          What about the Lin Reg Slope working with indicators as Input?

                          NO errors and when I remove the condition with the Lin Reg slope my trades go the full date range. That is why I think It might not work with different inputs
                          thanks

                          Comment


                            #14
                            Hello DTSSTS,

                            Thanks for your reply.

                            The Lin Reg Slope indicator allows any input. There is no alternate version of the indicator needed. The Lin Reg, Lin Reg Intercept, and Lin Reg Slope all allow for any input, including using another indicator as an input. You may need to print all values from your condition to understand when the condition is evaluated to be true vs. when it is false and the code inside the condition is not triggered.

                            Please feel free to reach out with any additional questions or concerns.
                            Emily C.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Skifree, Today, 03:41 AM
                            1 response
                            2 views
                            0 likes
                            Last Post Skifree
                            by Skifree
                             
                            Started by usazencort, Today, 01:16 AM
                            0 responses
                            1 view
                            0 likes
                            Last Post usazencort  
                            Started by kaywai, 09-01-2023, 08:44 PM
                            5 responses
                            603 views
                            0 likes
                            Last Post NinjaTrader_Jason  
                            Started by xiinteractive, 04-09-2024, 08:08 AM
                            6 responses
                            23 views
                            0 likes
                            Last Post xiinteractive  
                            Started by Pattontje, Yesterday, 02:10 PM
                            2 responses
                            23 views
                            0 likes
                            Last Post Pattontje  
                            Working...
                            X